:root {
  color-scheme: light;
  --canvas: #f6f8fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-hover: #f8fafc;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --border: #d9e0ea;
  --border-strong: #cbd5e1;
  --primary: #3659d9;
  --primary-hover: #2747c4;
  --primary-soft: #eef2ff;
  --primary-contrast: #ffffff;
  --nav: #111827;
  --nav-raised: #1b2535;
  --nav-text: #e5edf8;
  --nav-muted: #91a0b5;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --focus: #2563eb;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow-md: 0 12px 30px rgb(15 23 42 / 10%);
  --shadow-lg: 0 24px 60px rgb(15 23 42 / 18%);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --sidebar-width: 264px;
  --topbar-height: 64px;
  --content-width: 1600px;
  --mobile-nav-height: 72px;
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
}

.drive-picker-toolbar {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--primary, #3659d9) 24%, var(--border));
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--primary, #3659d9) 5%, var(--surface));
}

.drive-picker-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.drive-picker-panel [data-picker-status] {
  flex-basis: 100%;
  min-height: 1.25rem;
  margin: 0;
}

.text-danger { color: var(--danger, #b91c1c) !important; }

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0b1220;
  --surface: #111b2c;
  --surface-raised: #172235;
  --surface-subtle: #1c293c;
  --surface-hover: #1b293d;
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #2f4058;
  --border-strong: #475569;
  --primary: #6d8cff;
  --primary-hover: #88a1ff;
  --primary-soft: #1d2c55;
  --primary-contrast: #081122;
  --nav: #07101e;
  --nav-raised: #152236;
  --nav-text: #f1f5f9;
  --nav-muted: #94a3b8;
  --success: #4ade80;
  --success-soft: #133121;
  --warning: #fbbf24;
  --warning-soft: #3c2d13;
  --danger: #f87171;
  --danger-soft: #3c1d22;
  --info: #93c5fd;
  --info-soft: #172f53;
  --violet: #c4b5fd;
  --violet-soft: #2d2350;
  --focus: #93c5fd;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);
  --shadow-md: 0 14px 34px rgb(0 0 0 / 28%);
  --shadow-lg: 0 28px 70px rgb(0 0 0 / 44%);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
    --canvas: #0b1220;
    --surface: #111b2c;
    --surface-raised: #172235;
    --surface-subtle: #1c293c;
    --surface-hover: #1b293d;
    --text: #f8fafc;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #2f4058;
    --border-strong: #475569;
    --primary: #6d8cff;
    --primary-hover: #88a1ff;
    --primary-soft: #1d2c55;
    --primary-contrast: #081122;
    --nav: #07101e;
    --nav-raised: #152236;
    --nav-text: #f1f5f9;
    --nav-muted: #94a3b8;
    --success: #4ade80;
    --success-soft: #133121;
    --warning: #fbbf24;
    --warning-soft: #3c2d13;
    --danger: #f87171;
    --danger-soft: #3c1d22;
    --info: #93c5fd;
    --info-soft: #172f53;
    --violet: #c4b5fd;
    --violet-soft: #2d2350;
    --focus: #93c5fd;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);
    --shadow-md: 0 14px 34px rgb(0 0 0 / 28%);
    --shadow-lg: 0 28px 70px rgb(0 0 0 / 44%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.sidebar-open,
body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
[role="button"] {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .52;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.3;
}

h1 {
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -.04em;
}

h2 {
  font-size: clamp(19px, 2.7vw, 23px);
  letter-spacing: -.025em;
}

h3 {
  font-size: 16px;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 34%, transparent);
  outline-offset: 2px;
}

::selection {
  color: var(--primary-contrast);
  background: var(--primary);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-subtle);
  overflow-wrap: anywhere;
}

.sidebar-profile {
  display: grid;
  gap: var(--space-2);
  margin-top: auto;
  padding: var(--space-4);
  border-top: 1px solid color-mix(in srgb, var(--nav-text) 14%, transparent);
  color: var(--nav-text);
}

.sidebar-profile > a {
  display: flex;
  min-height: 44px;
  align-items: center;
  margin: -6px -8px 0;
  padding: 6px 8px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}

.sidebar-profile > a:hover,
.sidebar-profile > a:focus-visible {
  color: #fff;
  background: rgb(255 255 255 / 9%);
}

.sidebar-profile span {
  color: var(--nav-muted);
}

progress.progress {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
}

progress.progress::-webkit-progress-bar { background: var(--surface-subtle); }
progress.progress::-webkit-progress-value { background: var(--primary); }
progress.progress::-moz-progress-bar { background: var(--primary); }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: var(--space-3);
  left: var(--space-3);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--primary);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Authentication */
.auth-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: max(var(--space-6), env(safe-area-inset-top)) max(var(--space-4), env(safe-area-inset-right)) max(var(--space-6), env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
  background:
    radial-gradient(circle at 15% 12%, color-mix(in srgb, var(--primary) 15%, transparent), transparent 32%),
    radial-gradient(circle at 88% 88%, color-mix(in srgb, var(--violet) 11%, transparent), transparent 30%),
    var(--canvas);
}

.auth-card {
  width: min(100%, 460px);
  padding: clamp(24px, 6vw, 40px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-lg);
}

.auth-card .brand {
  margin-bottom: var(--space-8);
  color: var(--text);
}

.auth-card h1 {
  margin-bottom: var(--space-2);
  font-size: clamp(25px, 7vw, 32px);
}

.auth-card > p {
  margin-bottom: var(--space-6);
  color: var(--text-muted);
}

.auth-card .button {
  width: 100%;
}

/* Main application shell */
.app-shell {
  min-height: 100vh;
  min-height: 100svh;
}

.sidebar {
  position: fixed;
  z-index: 110;
  inset: 0 auto 0 0;
  display: flex;
  width: min(var(--sidebar-width), 88vw);
  flex-direction: column;
  gap: var(--space-5);
  overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  color: var(--nav-text);
  background:
    radial-gradient(circle at 12% 8%, rgb(77 103 190 / 20%), transparent 24%),
    var(--nav);
  box-shadow: var(--shadow-lg);
  transform: translateX(-104%);
  transition: transform .22s ease;
}

.sidebar.is-open,
body.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-scrim {
  position: fixed;
  z-index: 100;
  inset: 0;
  visibility: hidden;
  border: 0;
  background: rgb(2 6 23 / 54%);
  opacity: 0;
  backdrop-filter: blur(2px);
  transition: opacity .2s ease, visibility .2s ease;
}

body.sidebar-open .sidebar-scrim,
.sidebar-scrim.is-visible {
  visibility: visible;
  opacity: 1;
}

.brand {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
  font-weight: 800;
  letter-spacing: .06em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #6d7cff, #3659d9 58%, #2d3f9f);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 28%), 0 8px 20px rgb(36 64 180 / 32%);
  font-size: 18px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy small {
  color: var(--nav-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-label {
  min-width: 0;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.nav-link {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: var(--space-3);
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--nav-text);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.nav-link:hover {
  border-color: rgb(255 255 255 / 8%);
  color: #fff;
  background: var(--nav-raised);
}

.nav-link.is-active,
.nav-link[aria-current="page"] {
  border-color: rgb(126 146 255 / 22%);
  color: #fff;
  background: linear-gradient(90deg, rgb(74 101 218 / 38%), rgb(74 101 218 / 16%));
  box-shadow: inset 3px 0 0 #7d91ff;
}

.nav-link svg,
.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.nav-badge {
  display: inline-grid;
  min-width: 24px;
  min-height: 22px;
  margin-left: auto;
  place-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  color: var(--nav-text);
  background: rgb(255 255 255 / 10%);
  font-size: 12px;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-width: 0;
  min-height: calc(var(--topbar-height) + env(safe-area-inset-top));
  align-items: center;
  gap: var(--space-3);
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.integration-status {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.integration-status:hover,
.integration-status:focus-visible {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-hover);
}

.integration-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-muted) 12%, transparent);
}

.integration-status.is-ready .integration-status-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent);
}

.integration-status.is-warning .integration-status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 15%, transparent);
}

.integration-status.is-neutral .integration-status-dot {
  background: var(--text-muted);
}

.sidebar-toggle,
.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-soft);
  background: var(--surface);
}

.sidebar-toggle:hover,
.icon-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-hover);
}

.search-form {
  display: flex;
  width: min(100%, 560px);
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: var(--space-2);
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  background: var(--surface-subtle);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.search-form:focus-within {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent);
}

.search-form input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.search-form kbd {
  display: none;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--surface);
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
}

.page {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 22px 13px calc(var(--mobile-nav-height) + 34px);
}

.page-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page-head h1 {
  margin-bottom: var(--space-1);
}

.page-head p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.page-actions {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.page-actions .button {
  flex: 1 1 auto;
}

/* Grids and cards */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

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

.grid > .span-2 {
  grid-column: 1 / -1;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.card,
.stat-card,
.project-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card {
  overflow: hidden;
}

.card-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.card-head h2,
.card-head h3,
.card-head p {
  margin-bottom: 0;
}

.card-head p {
  margin-top: var(--space-1);
  color: var(--text-muted);
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

.stat-card {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-4);
}

.stat-card > span,
.stat-card > small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.stat-card strong {
  margin-top: var(--space-1);
  font-size: clamp(22px, 5vw, 30px);
  letter-spacing: -.035em;
  line-height: 1.15;
}

.stat-card em {
  color: var(--text-soft);
  font-size: 12px;
  font-style: normal;
}

.project-card {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  gap: var(--space-4);
  overflow: hidden;
  padding: var(--space-5);
  color: var(--text);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.project-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--primary);
  content: "";
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card.status-warning::before,
.project-card.is-warning::before {
  background: var(--warning);
}

.project-card.status-risk::before,
.project-card.status-danger::before,
.project-card.is-risk::before {
  background: var(--danger);
}

.project-card.status-complete::before,
.project-card.is-complete::before {
  background: var(--success);
}

.project-card-head,
.project-card-meta,
.project-card-foot {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.project-card h2,
.project-card h3,
.project-card p {
  margin-bottom: 0;
}

.project-card p,
.project-card-meta {
  color: var(--text-muted);
  font-size: 13px;
}

.project-card-foot {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.project-portfolio-grid {
  align-items: stretch;
}

.project-portfolio-grid .project-card {
  min-height: 246px;
}

.project-scope {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 700;
}

.project-progress {
  display: grid;
  gap: 7px;
}

.project-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: 12px;
}

.project-progress-copy strong {
  color: var(--text);
  font-size: 13px;
}

.project-progress .progress {
  height: 7px;
}

.progress > span[data-progress] {
  width: var(--progress, 0%);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
}

.progress > span {
  display: block;
  width: var(--progress, 0%);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #7c6df2);
}

.task-row {
  display: grid;
  min-height: 76px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.task-row + .task-row {
  margin-top: var(--space-2);
}

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

.task-row.status-blocked,
.task-row.status-risk {
  border-left: 4px solid var(--danger);
}

.task-row.status-warning,
.task-row.status-pending {
  border-left: 4px solid var(--warning);
}

.task-row.status-complete {
  border-left: 4px solid var(--success);
}

.task-row h3,
.task-row strong,
.task-row p {
  margin-bottom: 0;
}

.task-row p,
.task-meta {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 12px;
}

.task-table td:first-child small {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-muted);
}

/* Task portfolio */
.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.task-summary-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 116px;
  align-content: space-between;
  gap: 4px;
  overflow: hidden;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.task-summary-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
  content: "";
}

.task-summary-card > span,
.task-summary-card > small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.task-summary-card > strong {
  color: var(--text);
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -.04em;
  line-height: 1;
}

.task-summary-card.is-risk::before,
.task-summary-card.is-blocked::before {
  background: var(--danger);
}

.task-summary-card.is-risk > strong,
.task-summary-card.is-blocked > strong {
  color: var(--danger);
}

.task-summary-card.is-active::before {
  background: var(--info);
}

.task-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: var(--space-3);
  overflow: visible;
  padding: var(--space-4);
}

.task-filter-form .field,
.task-filter-form input,
.task-filter-form select {
  width: 100%;
  min-width: 0;
}

.task-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.task-list-card {
  overflow: hidden;
}

.task-list-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.task-list-head h2,
.task-list-head p {
  margin: 0;
}

.task-list-head h2 {
  font-size: 18px;
}

.task-list-head h2 span {
  margin-left: 5px;
  color: var(--primary);
  font-size: 13px;
}

.task-list-head p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.task-list-card .task-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.task-table {
  min-width: 820px;
  table-layout: fixed;
}

.task-table .task-col-title { width: 42%; }
.task-table .task-col-progress { width: 18%; }
.task-table .task-col-owner { width: 20%; }
.task-table .task-col-schedule { width: 20%; }

.task-table th,
.task-table td {
  padding: 15px 18px;
}

.task-table th {
  position: sticky;
  z-index: 3;
  top: 0;
}

.task-table td {
  vertical-align: top;
}

.task-table tbody tr {
  transition: background .14s ease;
}

.task-table tbody tr.is-overdue > td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.task-title-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title-link:hover,
.task-title-link:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.task-context,
.task-inline-meta,
.task-status-line,
.task-progress-copy {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
}

.task-context {
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
}

.task-context > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-project-code {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 750;
}

.task-inline-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.task-inline-meta > span + span::before {
  margin-right: 8px;
  content: "·";
}

.task-progress-copy {
  justify-content: space-between;
  margin-bottom: 7px;
}

.task-progress-copy strong {
  color: var(--text);
  font-size: 14px;
}

.task-progress-copy span,
.task-table td > small {
  color: var(--text-muted);
  font-size: 11px;
}

.task-progress-meter {
  display: block;
  width: 100%;
  height: 8px;
  margin: 0 0 7px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  appearance: none;
}

.task-progress-meter::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--surface-subtle);
}

.task-progress-meter::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--info));
}

.task-progress-meter::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--info));
}

.task-owner {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.task-owner strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.task-status-line .badge {
  min-height: 25px;
  padding: 3px 8px;
  font-size: 11px;
}

.task-priority {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: var(--surface-subtle);
  font-size: 10px;
  font-weight: 750;
}

.task-priority.priority-urgent,
.task-priority.priority-high {
  color: var(--danger);
  background: var(--danger-soft);
}

.task-date-range,
.task-schedule-status {
  display: block;
}

.task-schedule-status {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 14px;
}

.task-schedule-status.is-overdue {
  color: var(--danger);
}

.task-schedule-status.is-soon {
  color: var(--warning);
}

.task-schedule-status.is-complete {
  color: var(--success);
}

.task-schedule-status.is-unplanned {
  color: var(--text-muted);
  font-size: 12px;
}

.task-date-range {
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.task-list-empty {
  min-height: 300px;
  padding: var(--space-8);
}

.project-schedule-manager .card-head {
  align-items: center;
  flex-wrap: wrap;
}

.project-schedule-manager .card-head .page-actions {
  align-items: center;
  justify-content: flex-end;
}

.schedule-structure-grid {
  align-items: start;
}

.schedule-structure-grid > div {
  min-width: 0;
}

.schedule-structure-grid > div > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: 16px;
}

.schedule-structure-grid .timeline {
  min-height: 0;
}

.compact-empty-state {
  min-height: 124px;
  padding: var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.compact-empty-state p {
  margin: 0;
}

/* Buttons and status labels */
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

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

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 78%, #fff), var(--primary));
  box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 20%, transparent);
}

html[data-theme="dark"] .button-primary {
  color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 78%, #fff), color-mix(in srgb, var(--primary) 78%, #000));
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.button-secondary {
  border-color: var(--border);
  color: var(--text-soft);
  background: var(--surface);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-hover);
}

.button-ghost {
  color: var(--text-soft);
  background: transparent;
}

.button-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-hover);
}

.button-danger {
  border-color: color-mix(in srgb, var(--danger) 25%, var(--border));
  color: var(--danger);
  background: var(--danger-soft);
}

.button-success {
  border-color: color-mix(in srgb, var(--success) 25%, var(--border));
  color: var(--success);
  background: var(--success-soft);
}

.button-sm {
  min-height: 40px;
  padding: 7px 12px;
  font-size: 13px;
}

.button-icon {
  width: 44px;
  padding: 0;
}

.button-block {
  width: 100%;
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}

.badge-success,
.status-success,
.status-active,
.status-complete {
  border-color: color-mix(in srgb, var(--success) 28%, var(--border));
  color: var(--success);
  background: var(--success-soft);
}

.badge-warning,
.status-warning,
.status-pending {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--border));
  color: var(--warning);
  background: var(--warning-soft);
}

.badge-danger,
.status-danger,
.status-risk,
.status-blocked,
.status-inactive {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  color: var(--danger);
  background: var(--danger-soft);
}

.badge-info,
.status-info,
.status-review {
  border-color: color-mix(in srgb, var(--info) 28%, var(--border));
  color: var(--info);
  background: var(--info-soft);
}

.badge-neutral,
.status-neutral,
.status-archived {
  color: var(--text-muted);
  background: var(--surface-subtle);
}

/* Timeline */
.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 26px;
  list-style: none;
}

.timeline::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 8px;
  width: 2px;
  background: var(--border);
  content: "";
}

.timeline-item {
  position: relative;
  display: flex;
  min-height: 44px;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  padding: 0 0 var(--space-6);
}

.timeline-item > div:first-child {
  min-width: 0;
  flex: 1 1 200px;
}

.timeline-item > time,
.timeline-item > small {
  flex: 0 0 auto;
}

/* A link row must be one solid touch target. As an inline element the anchor
   fragments into separate boxes and min-height is ignored, which leaves dead
   space between the title and the date on phones. */
a.timeline-item {
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a.timeline-item:hover strong,
a.timeline-item:focus-visible strong {
  color: var(--primary);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  position: absolute;
  top: 5px;
  left: -24px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  content: "";
}

.timeline-item.status-complete::before {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.timeline-item.status-risk::before,
.timeline-item.status-blocked::before {
  background: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.timeline-item h3,
.timeline-item p {
  margin-bottom: var(--space-1);
}

.timeline-item time,
.timeline-item small {
  color: var(--text-muted);
  font-size: 12px;
}

/* Some views use one element as both the card body and the timeline. Keep the
   card gutter instead of letting the timeline padding shorthand erase it. */
.card-body.timeline {
  --timeline-card-padding-block: var(--space-5);
  --timeline-card-padding-inline: var(--space-5);
  padding: var(--timeline-card-padding-block) var(--timeline-card-padding-inline)
    var(--timeline-card-padding-block) calc(var(--timeline-card-padding-inline) + 26px);
}

.card-body.timeline::before {
  top: calc(var(--timeline-card-padding-block) + 9px);
  bottom: calc(var(--timeline-card-padding-block) + 9px);
  left: calc(var(--timeline-card-padding-inline) + 8px);
}

/* Empty timelines must not leave an orphaned rail beside the message. */
.timeline:has(> .empty-state:only-child) {
  padding-left: 0;
}

.timeline:has(> .empty-state:only-child)::before {
  content: none;
}

.card-body.timeline:has(> .empty-state:only-child) {
  padding-left: var(--timeline-card-padding-inline);
}

/* Disclosure */
details > summary {
  min-height: 44px;
  padding: 11px 0;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

details > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

details[open] > summary {
  margin-bottom: var(--space-2);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-soft);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

td {
  font-size: 14px;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-hover);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > label,
.field-label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 1px 1px rgb(15 23 42 / 3%);
  font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

textarea {
  min-height: 116px;
  resize: vertical;
}

select {
  cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: .86;
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.field-help,
.field-error {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.field-error,
.field.has-error .field-help {
  color: var(--danger);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
[aria-invalid="true"] {
  border-color: var(--danger) !important;
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 52px !important;
}

.input-with-action [data-password-toggle] {
  position: absolute;
  top: 50%;
  right: 3px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  transform: translateY(-50%);
}

.filter-form,
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  margin-bottom: var(--space-5);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.filter-form input,
.filter-form select {
  width: auto;
  min-width: 150px;
}

.filter-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.filter-chip:hover,
.filter-chip.is-active,
.filter-chip[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  color: var(--primary);
  background: var(--primary-soft);
}

/* Project schedule */
.project-view-switch {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
  box-shadow: var(--shadow-sm);
}

.project-view-switch > a,
.project-view-switch > button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.project-view-switch > a:hover,
.project-view-switch > button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.project-view-switch > .is-active,
.project-view-switch > [aria-current="page"],
.project-view-switch > [aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.schedule-toolbar {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.schedule-filter {
  display: grid;
  min-width: 0;
  width: 100%;
  grid-template-columns: minmax(210px, 1.45fr) repeat(4, minmax(120px, 1fr));
  align-items: flex-end;
  gap: var(--space-2);
}

.schedule-filter > .field {
  width: 100%;
  min-width: 0;
}

.schedule-filter > .button {
  grid-column: 1 / -1;
  justify-self: end;
}

.schedule-meta {
  display: flex;
  width: 100%;
  min-height: 40px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-left: 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  white-space: normal;
}

.schedule-insight-bar {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--space-4);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-subtle) 72%, var(--surface));
  font-size: 12px;
}

.schedule-insight-bar > span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: var(--radius-pill);
  background: var(--surface);
  white-space: nowrap;
}

.schedule-insight-bar > span.is-warning {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--border));
  color: color-mix(in srgb, var(--warning) 78%, var(--text));
  background: var(--warning-soft);
  font-weight: 700;
}

.schedule-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.gantt-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.gantt-grid {
  --gantt-columns: 12;
  --gantt-label-width: clamp(260px, 24vw, 320px);
  --gantt-track-width: 1008px;
  --gantt-project-row-height: 68px;
  --gantt-task-row-height: 56px;
  min-width: calc(var(--gantt-label-width) + var(--gantt-track-width));
  color: var(--text);
  background: var(--surface);
}

.gantt-grid[data-column-count="5"] {
  --gantt-track-width: 700px;
}

.gantt-grid[data-column-count="9"] {
  --gantt-track-width: 1008px;
}

.gantt-grid[data-column-count="13"] {
  --gantt-track-width: 1456px;
}

.gantt-header,
.gantt-header-row,
.gantt-row {
  display: grid;
  grid-template-columns: var(--gantt-label-width) minmax(var(--gantt-track-width), 1fr);
}

.gantt-header,
.gantt-header-row {
  position: sticky;
  z-index: 8;
  top: 0;
  min-height: 48px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-subtle);
}

.gantt-header {
  min-height: 72px;
}

.gantt-label-head,
.gantt-label {
  position: sticky;
  left: 0;
  border-right: 1px solid var(--border);
}

.gantt-label-head {
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  padding: 10px var(--space-4);
  color: var(--text-muted);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 700;
}

.gantt-label-head strong {
  color: var(--text);
  font-size: 13px;
}

.gantt-label-head small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.gantt-calendar-stack {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-rows: 30px 42px;
  background: var(--surface-subtle);
}

.gantt-months {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary-soft) 38%, var(--surface-subtle));
}

.gantt-month-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  min-width: 28px;
  align-items: center;
  overflow: hidden;
  padding: 0 8px;
  border-right: 1px solid var(--border-strong);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-calendar,
.gantt-calendar-head {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(var(--gantt-columns), minmax(0, 1fr));
}

.gantt-calendar > span,
.gantt-calendar-head > span {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
}

.gantt-calendar-stack > .gantt-today {
  z-index: 9;
}

.gantt-calendar > span:last-child,
.gantt-calendar-head > span:last-child {
  border-right: 0;
}

.gantt-row {
  min-height: var(--gantt-project-row-height);
  border-bottom: 1px solid var(--border);
}

.gantt-row.is-project {
  background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
}

.gantt-row.is-project .gantt-label,
.gantt-row.is-project .gantt-track {
  background-color: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
}

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

.gantt-row.is-child,
.gantt-row.is-task,
.gantt-task-row {
  min-height: var(--gantt-task-row-height);
  background: color-mix(in srgb, var(--surface-subtle) 58%, transparent);
}

.gantt-label {
  z-index: 5;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px var(--space-4);
  border-top: 0;
  border-bottom: 0;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  text-decoration: none;
}

button.gantt-label {
  width: 100%;
  border-left: 0;
}

.gantt-label:hover,
.gantt-label:focus-visible {
  color: var(--primary);
  background: var(--surface-hover);
}

.gantt-row.is-child .gantt-label,
.gantt-row.is-task .gantt-label,
.gantt-task-row .gantt-label {
  padding-left: 42px;
  background: color-mix(in srgb, var(--surface-subtle) 82%, var(--surface));
}

.gantt-label > span:last-child,
.gantt-label-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
}

.gantt-label-copy {
  color: inherit;
  text-decoration: none;
}

.gantt-label strong,
.gantt-label-title {
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-label small,
.gantt-label-meta {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-project-toggle {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-soft);
  background: var(--surface);
}

.gantt-track {
  position: relative;
  min-width: 0;
  min-height: inherit;
  overflow: hidden;
  background-color: var(--surface);
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--border) 1px);
  background-size: calc(100% / var(--gantt-columns)) 100%;
}

.gantt-row:hover .gantt-track {
  background-color: var(--surface-hover);
}

.gantt-row.is-child .gantt-track,
.gantt-row.is-task .gantt-track,
.gantt-task-row .gantt-track {
  background-color: color-mix(in srgb, var(--surface-subtle) 58%, transparent);
}

.gantt-bar {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 0;
  display: flex;
  min-width: 16px;
  max-width: 100%;
  height: 27px;
  align-items: center;
  overflow: hidden;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--primary) 58%, transparent);
  border-radius: 7px;
  color: var(--primary-contrast);
  background: linear-gradient(90deg, var(--primary-hover), var(--primary));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 23%, transparent);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
}

.gantt-bar::before {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--gantt-progress, 0%);
  border-right: 1px solid color-mix(in srgb, #fff 54%, transparent);
  background: color-mix(in srgb, #fff 18%, transparent);
  content: "";
  pointer-events: none;
}

.gantt-bar-label {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-bar.is-one-day {
  min-width: 38px;
  justify-content: center;
}

.gantt-bar.is-backlog {
  min-width: 104px;
  border-left-width: 4px;
  border-left-color: color-mix(in srgb, var(--danger) 82%, #000);
  border-radius: 4px 8px 8px 4px;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--danger) 28%, transparent);
}

button.gantt-bar {
  justify-content: flex-start;
}

.gantt-bar[data-start][data-due] {
  min-width: 16px;
}

.gantt-bar:hover,
.gantt-bar:focus-visible {
  z-index: 6;
  filter: brightness(1.06);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 32%, transparent);
}

.gantt-bar.status-completed,
.gantt-bar.is-complete {
  border-color: color-mix(in srgb, var(--success) 62%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--success) 82%, #000), var(--success));
}

.gantt-bar.status-blocked,
.gantt-bar.status-overdue,
.gantt-bar.is-blocked,
.gantt-bar.is-overdue {
  border-color: color-mix(in srgb, var(--danger) 72%, transparent);
  background: repeating-linear-gradient(-45deg, var(--danger), var(--danger) 7px,
    color-mix(in srgb, var(--danger) 78%, #fff) 7px,
    color-mix(in srgb, var(--danger) 78%, #fff) 14px);
}

.gantt-bar.status-on-hold,
.gantt-bar.is-warning {
  border-color: color-mix(in srgb, var(--warning) 68%, transparent);
  color: #fff;
  background: linear-gradient(90deg, color-mix(in srgb, var(--warning) 84%, #000), var(--warning));
}

.gantt-bar.status-review-pending,
.gantt-bar.is-review {
  border-color: color-mix(in srgb, var(--violet) 68%, transparent);
  color: #fff;
  background: linear-gradient(90deg, color-mix(in srgb, var(--violet) 82%, #000), var(--violet));
}

.gantt-today {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 65%, transparent);
  pointer-events: none;
}

.gantt-today::before {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  content: "";
  transform: translateX(-50%);
}

.gantt-row.is-task .gantt-today::before {
  display: none;
}

.gantt-today > span {
  position: absolute;
  top: 4px;
  left: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--primary-contrast);
  background: var(--primary);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
}

.gantt-meeting-marker {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid var(--violet);
  border-radius: 3px;
  background: var(--violet-soft);
  box-shadow: 0 0 0 3px var(--surface);
  transform: translate(-50%, -50%) rotate(45deg);
}

.gantt-meeting-marker[data-date] {
  display: block;
}

.gantt-meeting-marker:hover,
.gantt-meeting-marker:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.gantt-milestone-marker {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 3px solid var(--warning);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--surface) 88%, transparent);
  transform: translate(-50%, -50%);
}

.gantt-milestone-marker.status-success {
  border-color: var(--success);
  background: var(--success-soft);
}

.gantt-milestone-marker.status-danger {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.gantt-milestone-marker.status-info {
  border-color: var(--info);
  background: var(--info-soft);
}

.gantt-milestone-marker.status-warning {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-subtle);
  font-size: 12px;
}

.gantt-legend > span,
.gantt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.gantt-legend-swatch,
.legend-bar {
  display: inline-block;
  width: 24px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--primary);
}

.gantt-legend-swatch.is-blocked,
.legend-bar.is-blocked {
  background: var(--danger);
}

.gantt-legend-swatch.is-complete,
.legend-bar.is-complete {
  background: var(--success);
}

.legend-today {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--primary);
}

.legend-meeting {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid var(--violet);
  border-radius: 2px;
  background: var(--violet-soft);
  transform: rotate(45deg);
}

.legend-milestone {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 3px solid var(--warning);
  border-radius: 50%;
  background: var(--surface);
}

.schedule-roadmap {
  display: none;
}

.roadmap-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.roadmap-section > h2,
.roadmap-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 2px var(--space-1);
}

.roadmap-section > h2 {
  font-size: 16px;
}

.roadmap-item {
  display: grid;
  min-height: 78px;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  text-decoration: none;
}

.roadmap-item:hover,
.roadmap-item:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
  background: var(--surface-hover);
}

.roadmap-item.is-milestone {
  border-left: 4px solid var(--warning);
  background: color-mix(in srgb, var(--warning-soft) 42%, var(--surface));
}

.roadmap-item > .badge,
.roadmap-item > .status-badge {
  grid-row: span 2;
}

.roadmap-item strong,
.roadmap-item small {
  min-width: 0;
}

.roadmap-item strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roadmap-item small {
  color: var(--text-muted);
  font-size: 12px;
}

.detail-list {
  display: grid;
  margin: 0;
}

.detail-list > div {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
  gap: var(--space-3);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--text-muted);
  font-weight: 650;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.feature-list {
  display: grid;
  gap: var(--space-3);
}

.feature-list > div {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.feature-list p {
  margin: var(--space-1) 0 0;
  color: var(--text-muted);
}

/* Alerts and feedback */
.alert,
.flash {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-soft);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.alert .button,
.flash .button {
  align-self: flex-start;
  margin-top: var(--space-2);
}

.alert p,
.flash p {
  margin-bottom: 0;
}

.flash-with-action {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.flash-with-action > span {
  min-width: 0;
  flex: 1 1 200px;
}

.flash-with-action .button {
  align-self: center;
  margin-top: 0;
}

.alert-success,
.flash-success {
  border-color: color-mix(in srgb, var(--success) 28%, var(--border));
  color: var(--success);
  background: var(--success-soft);
}

.alert-warning,
.flash-warning {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--border));
  color: var(--warning);
  background: var(--warning-soft);
}

.alert-danger,
.flash-danger,
.flash-error {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  color: var(--danger);
  background: var(--danger-soft);
}

.alert-info,
.flash-info {
  border-color: color-mix(in srgb, var(--info) 28%, var(--border));
  color: var(--info);
  background: var(--info-soft);
}

.flash {
  position: relative;
  transition: opacity .2s ease, transform .2s ease;
}

.flash.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

.flash [data-flash-close] {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  margin: -8px -8px -8px auto;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: currentColor;
  background: transparent;
}

/* Tabs and empty states */
.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  overflow-x: auto;
  margin-bottom: var(--space-5);
  padding: var(--space-1);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

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

.tabs a,
.tabs button,
.tab {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tabs .is-active,
.tabs [aria-current="page"],
.tabs [aria-selected="true"],
.tab.is-active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.empty-state {
  display: flex;
  min-height: 240px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  background: var(--surface);
  text-align: center;
}

.empty-state > div {
  max-width: 440px;
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: var(--space-2);
}

.empty-state p {
  margin-bottom: var(--space-5);
}

.empty-state p:last-child {
  margin-bottom: 0;
}

/* Mobile navigation */
.mobile-nav {
  position: fixed;
  z-index: 80;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 5px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 -8px 26px rgb(15 23 42 / 8%);
  backdrop-filter: blur(14px);
}

.mobile-nav a,
.mobile-nav button {
  display: flex;
  min-width: 0;
  min-height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.mobile-nav a:hover,
.mobile-nav button:hover,
.mobile-nav .is-active,
.mobile-nav [aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}

.mobile-nav svg,
.mobile-nav .nav-icon {
  width: 21px;
  height: 21px;
}

.mobile-nav .nav-label {
  margin: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

/* Dialogs and modals */
dialog,
.modal[role="dialog"] {
  width: min(calc(100% - 24px), 680px);
  max-height: min(88vh, 840px);
  max-height: min(88dvh, 840px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgb(2 6 23 / 58%);
  backdrop-filter: blur(3px);
}

dialog:not([open]) {
  display: none;
}

.modal[role="dialog"]:not(dialog) {
  position: fixed;
  z-index: 200;
  top: 50%;
  left: 50%;
  display: none;
  transform: translate(-50%, -50%);
}

.modal[role="dialog"]:not(dialog).is-open {
  display: block;
}

.modal-backdrop {
  position: fixed;
  z-index: 190;
  inset: 0;
  display: none;
  background: rgb(2 6 23 / 58%);
  backdrop-filter: blur(3px);
}

.modal-backdrop.is-open {
  display: block;
}

.dialog-head,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.dialog-head h2,
.modal-head h2 {
  margin-bottom: 0;
}

.dialog-body,
.modal-body {
  padding: var(--space-5);
}

.dialog-footer,
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

/* Guest and administrator shells */
.guest-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--primary) 9%, transparent), transparent 28%),
    var(--canvas);
}

.guest-shell .topbar {
  padding-right: max(16px, env(safe-area-inset-right));
  padding-left: max(16px, env(safe-area-inset-left));
}

.guest-shell .page {
  max-width: 1180px;
  padding-bottom: var(--space-10);
}

.guest-notice {
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border));
  border-radius: var(--radius);
  color: var(--warning);
  background: var(--warning-soft);
}

.admin-accent {
  --primary: #6d4bd2;
  --primary-hover: #5b36c4;
  --primary-soft: #f5f3ff;
}

html[data-theme="dark"] .admin-accent {
  --primary: #b9a7ff;
  --primary-hover: #c9bcff;
  --primary-soft: #2d2350;
}

.admin-accent .sidebar,
.sidebar.admin-accent {
  background:
    radial-gradient(circle at 12% 8%, rgb(124 58 237 / 22%), transparent 26%),
    var(--nav);
}

/* Responsive enhancements */
@media (min-width: 560px) {
  .page {
    padding-right: 20px;
    padding-left: 20px;
  }

  .page-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .page-actions {
    width: auto;
    justify-content: flex-end;
  }

  .page-actions .button {
    flex: 0 0 auto;
  }

  .search-form kbd {
    display: inline-block;
  }

  .task-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}

@media (min-width: 720px) {
  .filter-form {
    width: 100%;
    align-items: flex-end;
    overflow: visible;
  }

  .filter-form > .field {
    flex: 0 0 auto;
  }

  .filter-form > .field-wide {
    display: grid;
    min-width: 0;
    flex: 1 1 360px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(44px, auto);
    gap: 7px var(--space-2);
  }

  .filter-form > .field-wide > .field-label,
  .filter-form > .field-wide > label {
    grid-column: 1 / -1;
  }

  .filter-form > .field-wide > input,
  .filter-form > .field-wide > select {
    width: 100%;
    min-width: 0;
  }

  .filter-form > .field-wide > .button {
    min-width: 96px;
    align-self: stretch;
  }

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

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

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

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

  .form-grid .span-2,
  .form-grid .field-wide {
    grid-column: span 2;
  }

  .card-head,
  .card-body {
    padding-right: var(--space-6);
    padding-left: var(--space-6);
  }

  .card-body.timeline {
    --timeline-card-padding-inline: var(--space-6);
  }
}

@media (max-width: 719px) {
  body {
    font-size: 16px;
  }

  .page {
    padding-top: var(--space-4);
  }

  .page-head {
    margin-bottom: var(--space-5);
  }

  .page-head > .page-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .page-head > .page-actions .button,
  .page-head > .button {
    width: 100%;
  }

  .card-head {
    flex-wrap: wrap;
  }

  .card-head > .button {
    flex: 1 1 100%;
  }

  .button-sm {
    min-height: 44px;
  }

  .field > label,
  .field-label {
    font-size: 14px;
  }

  .field-help,
  .field-error {
    font-size: 13px;
  }

  .filter-form,
  .filter-bar {
    display: grid;
    overflow: visible;
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-3);
  }

  .filter-form .field,
  .filter-bar .field,
  .filter-form input,
  .filter-form select,
  .filter-bar input,
  .filter-bar select {
    width: 100%;
    min-width: 0;
  }

  .project-view-switch {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-view-switch > a,
  .project-view-switch > button {
    white-space: normal;
  }

  .schedule-toolbar,
  .schedule-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-filter > .field,
  .schedule-filter > .button,
  .schedule-filter input,
  .schedule-filter select {
    width: 100%;
    min-width: 0;
  }

  .schedule-meta {
    min-height: 0;
    margin-left: 0;
    white-space: normal;
  }

  .schedule-shell,
  .desktop-gantt {
    display: none;
  }

  .schedule-roadmap {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
  }

  .task-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .task-table {
    display: block;
    min-width: 0;
  }

  .task-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .task-table tbody {
    display: grid;
    gap: var(--space-3);
  }

  .task-table tr {
    display: block;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .task-table td {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 9px 0;
    border: 0;
    border-top: 1px dashed var(--border);
    text-align: right;
  }

  .task-table td::before {
    flex: 0 0 70px;
    color: var(--text-muted);
    content: attr(data-label);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
  }

  .task-table td:first-child {
    display: block;
    padding-top: 0;
    border-top: 0;
    text-align: left;
  }

  .task-table td:first-child::before {
    display: none;
  }

  .task-table td:first-child a {
    display: flex;
    min-height: 44px;
    align-items: center;
    color: var(--text);
    font-size: 16px;
    text-decoration: none;
  }

  .task-table tbody tr:hover {
    background: var(--surface-hover);
  }

  dialog,
  .modal[role="dialog"] {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
  }

  dialog[open] {
    inset: auto 0 0;
    margin: 0;
  }

  .dialog-footer,
  .modal-footer {
    padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
  }
}

@media (min-width: 1024px) {
  :root {
    --topbar-height: 70px;
  }

  .sidebar {
    width: var(--sidebar-width);
    box-shadow: none;
    transform: none;
  }

  .sidebar-scrim,
  .sidebar-toggle,
  .mobile-nav {
    display: none !important;
  }

  .app-main {
    margin-left: var(--sidebar-width);
  }

  .topbar {
    padding-right: 28px;
    padding-left: 28px;
  }

  .page {
    padding: 30px 30px 64px;
  }

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

  .project-card {
    min-height: 210px;
  }
}

@media (min-width: 720px) {
  .task-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-form.task-filter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-filter-search,
  .task-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1200px) {
  .filter-form.task-filter-form {
    grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(120px, 1fr));
  }

  .task-filter-search {
    grid-column: auto;
  }

  .task-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1199px) {
  .task-list-card {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .task-list-head {
    margin-bottom: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .task-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .task-table {
    display: block;
    min-width: 0;
  }

  .task-table colgroup,
  .task-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .task-table tbody {
    display: grid;
    gap: var(--space-3);
  }

  .task-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .task-table tr.is-overdue {
    border-left: 4px solid var(--danger);
  }

  .task-table tbody tr.is-overdue > td:first-child {
    box-shadow: none;
  }

  .task-table td {
    display: block;
    min-width: 0;
    padding: var(--space-3) var(--space-4);
    border: 0;
    border-right: 1px solid var(--border);
    text-align: left;
  }

  .task-table td::before {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 750;
    text-align: left;
  }

  .task-table td:first-child {
    grid-column: 1 / -1;
    padding: var(--space-4);
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .task-table td:first-child::before {
    display: none;
  }

  .task-table td:last-child {
    border-right: 0;
  }

  .task-table td:first-child a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    color: var(--text);
    font-size: 15px;
    text-decoration: none;
  }
}

@media (max-width: 1100px) {
  .schedule-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-filter > .field:first-child,
  .schedule-filter > .button {
    grid-column: 1 / -1;
  }

  .schedule-filter > .button {
    width: 100%;
    justify-self: stretch;
  }

  .schedule-meta {
    justify-content: flex-start;
  }

  .schedule-shell,
  .desktop-gantt {
    display: none;
  }

  .schedule-roadmap {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
  }
}

@media (max-width: 900px) and (min-width: 560px) {
  .integration-status {
    width: 36px;
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .integration-status > span:last-child {
    display: none;
  }
}

@media (max-width: 719px) {
  .filter-form.task-filter-form,
  .schedule-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-filter-search,
  .task-filter-actions,
  .schedule-filter > .field:first-child,
  .schedule-filter > .button {
    grid-column: auto;
  }

  .task-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-list-head {
    flex-wrap: wrap;
    padding: var(--space-4);
  }

  .task-list-head > .button {
    width: 100%;
  }

  .task-table tr {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-table td {
    padding: var(--space-3) var(--space-4);
    border-right: 0;
    border-bottom: 1px dashed var(--border);
  }

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

  .task-table td:first-child {
    grid-column: auto;
  }

  .task-summary-card {
    min-height: 108px;
  }
}

@media (max-width: 559px) {
  .topbar-actions .optional-action {
    display: none;
  }

  .guest-shell .topbar {
    gap: var(--space-2);
  }

  .guest-shell .brand-copy small,
  .guest-shell .topbar-actions > .badge {
    display: none;
  }

  .guest-shell .topbar-actions {
    gap: var(--space-1);
  }

  .guest-shell .topbar-actions .button-sm {
    padding-right: 10px;
    padding-left: 10px;
  }

  .guest-shell .brand-mark {
    width: 36px;
    height: 36px;
  }

}

@media (max-width: 420px) {

  .stat-grid {
    gap: var(--space-2);
  }

  .stat-card {
    min-height: 104px;
    padding: var(--space-3);
  }

  .card-head,
  .card-body,
  .dialog-head,
  .dialog-body,
  .modal-head,
  .modal-body {
    padding: var(--space-4);
  }

  .card-body.timeline {
    --timeline-card-padding-block: var(--space-4);
    --timeline-card-padding-inline: var(--space-4);
  }

  .dialog-footer,
  .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: var(--space-3) var(--space-4);
  }

  .dialog-footer .button-primary,
  .modal-footer .button-primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (pointer: coarse) {
  .button-sm,
  .topbar-actions > a.badge {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .gantt-scroll {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  .card,
  .stat-card,
  .project-card,
  .task-row,
  .button,
  .badge,
  .alert,
  .flash,
  .table-wrap,
  .tabs,
  .project-view-switch,
  .schedule-toolbar,
  .schedule-shell,
  .roadmap-item,
  dialog,
  .modal[role="dialog"] {
    border: 1px solid CanvasText;
  }

  .nav-link.is-active,
  .nav-link[aria-current="page"],
  .button-primary,
  .project-view-switch > .is-active,
  .project-view-switch > [aria-current="page"],
  .project-view-switch > [aria-pressed="true"] {
    border: 2px solid Highlight;
  }

  .progress > span,
  .project-card::before,
  .timeline-item::before,
  .gantt-bar,
  .gantt-today {
    background: Highlight;
  }

  .gantt-bar {
    border-color: Highlight;
    color: HighlightText;
    forced-color-adjust: none;
  }

  .gantt-meeting-marker,
  .legend-meeting {
    border-color: CanvasText;
    background: Canvas;
  }
}

@media print {
  :root {
    color-scheme: light;
    --canvas: #fff;
    --surface: #fff;
    --surface-raised: #fff;
    --surface-subtle: #f4f4f5;
    --surface-hover: #fff;
    --text: #000;
    --text-soft: #222;
    --text-muted: #444;
    --border: #aaa;
    --border-strong: #777;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }

  body {
    min-width: 0;
    background: #fff;
    font-size: 11pt;
  }

  .sidebar,
  .sidebar-scrim,
  .topbar,
  .mobile-nav,
  .page-actions,
  .filter-form,
  .filter-bar,
  .flash,
  .no-print,
  dialog,
  .modal,
  button {
    display: none !important;
  }

  .app-main {
    margin: 0 !important;
  }

  .page,
  .guest-shell .page {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .card,
  .stat-card,
  .project-card,
  .task-row,
  .table-wrap {
    break-inside: avoid;
    box-shadow: none;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  a[href]::after {
    color: #555;
    content: " (" attr(href) ")";
    font-size: 9pt;
    font-weight: 400;
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }
}
