:root {
  --brand-color: #3C9BC5;
  --charcoal: #1A1A1A;
  --charcoal-2: #202020;
  --charcoal-3: #262626;
  --ocean: #3C9BC5;
  --steel: #4F86B0;
  --action: #2D7DD2;
  --teal: #0A5654;
  --teal-2: #0F6B69;
  --gold: #C17D2A;
  --ink: oklch(98% 0.004 230);
  --soft-text: rgb(247 250 252 / 0.78);
  --muted: rgb(247 250 252 / 0.62);
  --faint: rgb(247 250 252 / 0.36);
  --line: rgb(255 255 255 / 0.15);
  --line-strong: rgb(193 125 42 / 0.42);
  --gold-line: rgb(193 125 42 / 0.34);
  --gold-glow: rgb(193 125 42 / 0.20);
  --panel: rgb(255 255 255 / 0.074);
  --panel-strong: rgb(255 255 255 / 0.12);
  --success: #56B68B;
  --warning: #C17D2A;
  --danger: #D96B5F;
  --shadow: 0 28px 90px rgb(0 0 0 / 0.42);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #24201c 0%, #1f2020 42%, #1A1A1A 100%);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -2;
}

body::before {
  width: 58vw;
  height: 58vw;
  min-width: 620px;
  min-height: 620px;
  left: -20vw;
  top: -18vw;
  background: radial-gradient(circle, rgb(193 125 42 / 0.24), rgb(79 134 176 / 0.34) 36%, rgb(45 125 210 / 0.12) 52%, transparent 70%);
  filter: blur(84px);
  opacity: 0.9;
}

body::after {
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(112deg, transparent 0 28%, rgb(60 155 197 / 0.065) 29%, transparent 39%),
    radial-gradient(circle at 86% 14%, rgb(15 107 105 / 0.22), transparent 32rem),
    radial-gradient(circle at 72% 90%, rgb(193 125 42 / 0.22), transparent 30rem),
    repeating-radial-gradient(circle at 20% 10%, rgb(255 255 255 / 0.018) 0 1px, transparent 1px 4px);
  opacity: 0.86;
}

a { color: inherit; }

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

.portal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgb(26 26 26 / 0.82);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-lockup strong {
  display: block;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-lockup small,
.client-lockup span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, var(--teal), #073f3e);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.08em;
  box-shadow: 0 0 0 1px rgb(60 155 197 / 0.22), 0 18px 44px rgb(10 86 84 / 0.34);
}

.client-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: right;
}

.client-lockup strong { display: block; font-weight: 600; }

.login-page,
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card,
.error-card {
  width: min(100%, 520px);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.064));
  border: 1px solid var(--gold-line);
  border-top-color: rgb(226 169 91 / 0.46);
  border-radius: 1.25rem;
  padding: clamp(1.5rem, 5vw, 2.6rem);
  box-shadow: var(--shadow), 0 0 52px var(--gold-glow), inset 0 1px 0 rgb(255 255 255 / 0.07);
  position: relative;
  overflow: hidden;
}

.login-card::before,
.error-card::before,
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(128deg, rgb(193 125 42 / 0.13), transparent 34%, rgb(60 155 197 / 0.06));
}

.login-card > *,
.error-card > *,
.hero-panel > * { position: relative; }

.login-brand { margin-bottom: 2rem; }

.eyebrow {
  margin: 0 0 0.65rem;
  color: #D9A35D;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.052em;
  font-weight: 300;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.45rem);
  line-height: 1.08;
}

.muted {
  color: var(--soft-text);
  line-height: 1.72;
  font-size: 1.02rem;
}

.login-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.7rem;
}

.login-form label,
.filter-label {
  color: var(--soft-text);
  font-weight: 700;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.62rem;
  background: rgb(255 255 255 / 0.06);
  padding: 0.95rem 1rem;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
}

select option { color: #1A1A1A; }

textarea { resize: vertical; min-height: 6rem; }

input::placeholder,
textarea::placeholder { color: var(--faint); }

input:focus,
select:focus,
textarea:focus {
  border-color: rgb(193 125 42 / 0.72);
  box-shadow: 0 0 0 4px rgb(193 125 42 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.04);
}

.button {
  border: 0;
  border-radius: 0.62rem;
  padding: 0.88rem 1.1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgb(193 125 42 / 0.38); outline-offset: 3px; }

.button-primary {
  background: linear-gradient(180deg, var(--teal-2), var(--teal));
  color: var(--ink);
  box-shadow: 0 18px 34px rgb(10 86 84 / 0.34);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgb(15 107 105 / 0.9);
  box-shadow: 0 18px 34px rgb(0 0 0 / 0.18);
}

.button-ghost {
  background: rgb(255 255 255 / 0.055);
  color: var(--ink);
  border: 1px solid var(--line);
}

.full-width { width: 100%; margin-top: 0.55rem; }

.button-spinner,
.loader {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.34);
  border-top-color: var(--ink);
  display: none;
  animation: spin 0.8s linear infinite;
}

.is-loading .button-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
  line-height: 1.55;
}

.alert-error {
  background: linear-gradient(180deg, rgb(116 65 43 / 0.34), rgb(64 43 30 / 0.26));
  color: rgb(255 232 206 / 0.98);
  border: 1px solid rgb(193 125 42 / 0.38);
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.18), 0 0 30px rgb(193 125 42 / 0.10), inset 0 1px 0 rgb(255 255 255 / 0.055);
}

.alert-success {
  background: linear-gradient(180deg, rgb(15 107 105 / 0.34), rgb(10 86 84 / 0.22));
  color: rgb(232 255 249 / 0.96);
  border: 1px solid rgb(193 125 42 / 0.30);
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.18), 0 0 30px rgb(193 125 42 / 0.08), inset 0 1px 0 rgb(255 255 255 / 0.055);
}

.alert.large { margin: 0 0 1.2rem; }

.dashboard-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(4rem, 10vw, 7rem);
}

.hero-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.6rem, 5vw, 3.4rem);
  margin-bottom: 1.35rem;
  border-radius: 1.35rem;
  background: linear-gradient(135deg, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.055));
  border: 1px solid var(--gold-line);
  border-top-color: rgb(226 169 91 / 0.48);
  box-shadow: var(--shadow), 0 0 60px rgb(193 125 42 / 0.16), inset 0 1px 0 rgb(255 255 255 / 0.07);
  position: relative;
  overflow: hidden;
}

.hero-panel h1 { max-width: 760px; }

.sync-panel {
  display: grid;
  justify-items: end;
  gap: 0.85rem;
  min-width: min(100%, 280px);
}

.sync-meta {
  display: grid;
  gap: 0.34rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  text-align: right;
}

.sync-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.countdown {
  color: #F1C686;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.35rem;
}

.bottom-actions {
  justify-content: center;
  margin: 1.35rem auto 0;
  text-align: center;
}

.quick-actions .button {
  border-color: rgb(193 125 42 / 0.46);
  background: rgb(193 125 42 / 0.075);
  box-shadow: 0 16px 34px rgb(0 0 0 / 0.16), 0 0 28px rgb(193 125 42 / 0.10);
}

.grid { display: grid; gap: 1rem; }
.progress-grid { grid-template-columns: 2fr 1fr 1fr; margin-bottom: 1rem; }
.two-column-grid { grid-template-columns: 1fr 1fr; margin-top: 1rem; }

.card {
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--gold-line);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.18), 0 0 38px rgb(193 125 42 / 0.12), inset 0 1px 0 rgb(255 255 255 / 0.06);
}

.progress-card {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgb(193 125 42 / 0.14), rgb(255 255 255 / 0.055));
}

.card-heading,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-header.compact { margin-bottom: 0.85rem; }

.progress-track {
  width: 100%;
  height: 0.78rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.095);
  overflow: hidden;
  margin: 1.15rem 0 0.7rem;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.24);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-2), var(--ocean));
  box-shadow: 0 0 24px rgb(193 125 42 / 0.42);
}

.stat-card strong {
  display: block;
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.06em;
  color: var(--ink);
}

.stat-card span {
  color: var(--muted);
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.09);
  color: var(--soft-text);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-done,
.status-complete,
.status-completed,
.status-closed {
  background: rgb(86 182 139 / 0.13);
  color: #A6E3C2;
  border-color: rgb(86 182 139 / 0.26);
}

.status-in-progress,
.status-working {
  background: rgb(60 155 197 / 0.14);
  color: #A7DDF4;
  border-color: rgb(60 155 197 / 0.32);
}

.status-review {
  background: rgb(193 125 42 / 0.16);
  color: #F1C686;
  border-color: rgb(193 125 42 / 0.32);
}

.status-to-do,
.status-open {
  background: rgb(255 255 255 / 0.075);
  color: var(--muted);
}

.task-list { display: grid; gap: 0.7rem; }

.task-row {
  padding: 1rem;
  border: 1px solid rgb(193 125 42 / 0.24);
  border-radius: 0.82rem;
  background: rgb(255 255 255 / 0.052);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.task-row:hover {
  transform: translateY(-1px);
  border-color: rgb(193 125 42 / 0.36);
  background: rgb(193 125 42 / 0.07);
  box-shadow: 0 0 24px rgb(193 125 42 / 0.10);
}

.task-details { display: grid; gap: 0.8rem; }

.task-summary {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.task-summary::-webkit-details-marker { display: none; }

.expand-indicator {
  color: #F1C686;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.task-details[open] .expand-indicator { color: var(--soft-text); }
.task-details[open] .expand-indicator::after { content: ' open'; }

.task-main { display: grid; gap: 0.2rem; }
.task-main a,
.task-main strong { font-weight: 700; text-decoration: none; }
.task-main a:hover { color: #F1C686; }
.task-main span,
.due-date { color: var(--muted); font-size: 0.9rem; }

.task-progress {
  display: grid;
  gap: 0.32rem;
  margin-top: 0.35rem;
  max-width: 24rem;
}

.mini-progress-track {
  height: 0.42rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.10);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.24);
}

.mini-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #E2A95B);
  box-shadow: 0 0 18px rgb(193 125 42 / 0.38);
}

.task-progress small {
  color: var(--muted);
  font-weight: 600;
}

.subtask-panel {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgb(193 125 42 / 0.18);
}

.subtask-list { display: grid; gap: 0.55rem; }

.subtask-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.82rem;
  border-radius: 0.72rem;
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(193 125 42 / 0.18);
}

.subtask-row div { display: grid; gap: 0.18rem; }
.subtask-row span { color: var(--muted); font-size: 0.88rem; }
.empty-state.compact { padding: 0.85rem; }

.timeline-list,
.activity-list { display: grid; gap: 1rem; }

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 0.82rem;
  background: rgb(255 255 255 / 0.052);
  border: 1px solid rgb(193 125 42 / 0.22);
  box-shadow: 0 0 22px rgb(193 125 42 / 0.08);
}

.timeline-item p,
.activity-item p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.timeline-dot {
  width: 0.72rem;
  height: 0.72rem;
  margin-top: 0.38rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgb(193 125 42 / 0.72);
}

.timeline-item.overdue {
  background: rgb(217 107 95 / 0.12);
  border-color: rgb(217 107 95 / 0.28);
  color: rgb(255 221 217 / 0.96);
}

.timeline-item.overdue .timeline-dot {
  background: var(--danger);
  box-shadow: 0 0 18px rgb(217 107 95 / 0.68);
}

.activity-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.activity-item strong { font-weight: 700; }
.activity-item:last-child { border-bottom: 0; }

.comment-update {
  display: block;
}

.comment-update.is-read { opacity: 0.76; }

.comment-update-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
  list-style: none;
}

.comment-update-summary::-webkit-details-marker { display: none; }

.comment-update-panel {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.85rem;
}

.comment-update[open] .comment-update-summary .expand-indicator { color: var(--soft-text); }
.comment-update[open] .comment-update-summary .expand-indicator::after { content: 'ed'; }

.comment-update-header,
.comment-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.read-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgb(193 125 42 / 0.30);
  background: rgb(193 125 42 / 0.10);
  color: #F1C686;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.comment-update blockquote {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border-radius: 0.72rem;
  background: rgb(255 255 255 / 0.055);
  border: 1px solid rgb(193 125 42 / 0.18);
  color: var(--soft-text);
  line-height: 1.58;
}

.comment-thread {
  display: grid;
  gap: 0.6rem;
  margin-left: 0.8rem;
  padding-left: 0.9rem;
  border-left: 2px solid rgb(193 125 42 / 0.28);
}

.thread-label {
  margin: 0;
  color: #F1C686;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.threaded-reply {
  display: grid;
  gap: 0.25rem;
  padding: 0.72rem 0.85rem;
  border-radius: 0.72rem;
  background: rgb(10 86 84 / 0.22);
  border: 1px solid rgb(60 155 197 / 0.18);
}

.threaded-reply p {
  margin: 0;
  color: var(--soft-text);
  line-height: 1.5;
}

.threaded-reply small {
  color: var(--muted);
}

.comment-actions a,
.text-button {
  color: #F1C686;
  background: none;
  border: 0;
  padding: 0;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.comment-actions a:hover,
.text-button:hover { text-decoration: underline; }

.reply-form {
  display: grid;
  gap: 0.72rem;
}

.reply-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--soft-text);
  font-weight: 700;
  font-size: 0.9rem;
}

.reply-form .button { justify-self: start; }

.empty-state {
  border: 1px dashed rgb(193 125 42 / 0.34);
  border-radius: 0.82rem;
  padding: 1.2rem;
  color: var(--muted);
  background: rgb(193 125 42 / 0.06);
}

.loading-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.82rem 1rem;
  border-radius: 0.72rem;
  background: rgb(10 86 84 / 0.84);
  border: 1px solid rgb(60 155 197 / 0.28);
  color: var(--ink);
}

.loading-banner .loader { display: inline-block; }

@media (max-width: 860px) {
  .portal-header,
  .hero-panel,
  .client-lockup,
  .sync-panel {
    align-items: flex-start;
    justify-items: start;
    flex-direction: column;
    text-align: left;
  }

  .sync-meta { text-align: left; }

  .progress-grid,
  .two-column-grid { grid-template-columns: 1fr; }
  .task-summary,
  .subtask-row { grid-template-columns: 1fr; align-items: flex-start; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .comment-update-header,
  .comment-actions { flex-direction: column; }
  .filter-label { width: 100%; }
}

@media (max-width: 520px) {
  .login-page,
  .error-page { padding: 1rem; }
  .dashboard-shell { width: min(100% - 1rem, 1180px); padding-top: 1rem; }
  .card,
  .hero-panel,
  .login-card { border-radius: 1rem; }
  .brand-mark { width: 2.6rem; height: 2.6rem; }
  h1 { font-size: 2.5rem; }
}


/* Client dashboard redesign */
.dashboard-redesign {
  width: min(1280px, calc(100% - 2rem));
  padding-top: clamp(1rem, 3vw, 2rem);
}

.utility-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.utility-strip strong { color: var(--soft-text); }
.utility-divider { color: var(--faint); }

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
  gap: 1.15rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 1rem;
  border-radius: 1.15rem;
  background: linear-gradient(135deg, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.055));
  border: 1px solid var(--gold-line);
  border-top-color: rgb(226 169 91 / 0.48);
  box-shadow: var(--shadow), 0 0 52px rgb(193 125 42 / 0.14), inset 0 1px 0 rgb(255 255 255 / 0.07);
  position: relative;
  overflow: hidden;
}

.project-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(128deg, rgb(193 125 42 / 0.12), transparent 36%, rgb(60 155 197 / 0.06));
}

.project-hero > * { position: relative; }
.project-title-block h1 { font-size: clamp(2.2rem, 5vw, 4.1rem); }
.project-title-block .muted { max-width: 760px; margin-bottom: 0; }

.project-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  align-self: start;
}

.project-meta-grid div,
.summary-card,
.action-group,
.mini-task-card,
.meeting-card {
  border: 1px solid rgb(193 125 42 / 0.24);
  background: rgb(255 255 255 / 0.052);
  border-radius: 0.82rem;
}

.project-meta-grid div { padding: 0.8rem; }
.project-meta-grid span,
.summary-card p,
.mini-task-card p,
.action-task-card p,
.meeting-card p { color: var(--soft-text); }
.project-meta-grid strong { display: block; margin-top: 0.2rem; font-size: 1.02rem; }

.hero-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding-top: 0.2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-card {
  padding: 1rem;
  min-height: 13rem;
}

.summary-card h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  margin-bottom: 0.55rem;
}

.summary-card p { line-height: 1.5; margin: 0.55rem 0 0; }
.summary-number { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 300; letter-spacing: -0.07em; }
.priority-card,
.waiting-summary-card,
.health-card {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgb(193 125 42 / 0.13), rgb(255 255 255 / 0.056));
}

.status-at-risk,
.status-delayed { border-color: rgb(217 107 95 / 0.38); }
.status-waiting-on-client { border-color: rgb(193 125 42 / 0.42); color: #F1C686; }
.status-ready-for-review { border-color: rgb(60 155 197 / 0.4); color: #A7DDF4; }
.status-approved,
.status-complete,
.status-completed { color: #A6E3C2; }
.status-not-started { color: var(--soft-text); }

.focus-card { margin-bottom: 1rem; }
.focus-card .section-header { margin-bottom: 0.95rem; }

.action-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.action-group { padding: 1rem; }
.action-group h3,
.deliverable-group h3,
.file-group h3 {
  margin: 0 0 0.75rem;
  color: #F1C686;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.compact-task-list { display: grid; gap: 0.75rem; }
.action-task-card,
.mini-task-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}

.action-task-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid rgb(193 125 42 / 0.22);
  border-radius: 0.82rem;
  background: rgb(255 255 255 / 0.052);
}

.action-task-card strong,
.mini-task-card strong,
.meeting-card strong { font-size: 1.02rem; }
.action-task-card p,
.mini-task-card p { margin: 0.3rem 0; line-height: 1.5; }
.action-task-card small,
.mini-task-card small,
.file-row small { color: var(--muted); }

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(360px, 1.45fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.side-stack { display: grid; gap: 1rem; }

.roadmap-list { display: grid; gap: 0.75rem; }
.roadmap-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(193 125 42 / 0.18);
}

.roadmap-item.is-empty { opacity: 0.58; }
.roadmap-item strong { display: block; }
.roadmap-item p { margin: 0.25rem 0 0.45rem; color: var(--soft-text); font-size: 0.9rem; }
.roadmap-dot {
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.25rem;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 18px rgb(193 125 42 / 0.52);
}

.deliverable-group { display: grid; gap: 0.7rem; margin-bottom: 1rem; }
.deliverable-group:last-child { margin-bottom: 0; }
.redesigned-task-summary { grid-template-columns: minmax(0, 1fr) auto auto auto; }

.button-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.lower-grid { margin-top: 1rem; }

.meeting-card { padding: 1rem; display: grid; gap: 0.75rem; }
.meeting-card .button { justify-self: start; }

.file-group-list { display: grid; gap: 1rem; }
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.82rem;
  border-radius: 0.72rem;
  background: rgb(255 255 255 / 0.052);
  border: 1px solid rgb(193 125 42 / 0.20);
  text-decoration: none;
}
.file-row span { display: grid; gap: 0.2rem; }
.file-row em { color: #F1C686; font-style: normal; font-weight: 800; }

.is-complete { border-color: rgb(86 182 139 / 0.28); }

@media (max-width: 1120px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .dashboard-redesign { width: min(100% - 1rem, 1280px); }
  .utility-strip { justify-content: flex-start; }
  .project-hero,
  .project-meta-grid,
  .summary-grid { grid-template-columns: 1fr; }
  .hero-actions,
  .action-task-card,
  .redesigned-task-summary,
  .file-row { grid-template-columns: 1fr; align-items: stretch; }
  .action-task-card .button,
  .hero-actions .button { width: 100%; }
  .project-title-block h1 { font-size: 2.25rem; }
}


/* Recent update priority/read states */
.comment-update.is-read {
  opacity: 0.68;
  border-color: rgb(255 255 255 / 0.12);
}

.comment-update.needs-reply:not(.is-read) {
  border-color: rgb(193 125 42 / 0.42);
  background: rgb(193 125 42 / 0.055);
}

.read-state.is-new-label {
  color: #111827;
  background: #F1C686;
  border-color: #F1C686;
}

.read-state.is-read-label {
  color: #A6E3C2;
  background: rgb(86 182 139 / 0.12);
  border-color: rgb(86 182 139 / 0.35);
}

/* Impeccable premium portal polish */
:root {
  --surface-root: oklch(15.5% 0.014 72);
  --surface-warm: oklch(18.5% 0.018 68);
  --surface-raised: oklch(22% 0.015 73 / 0.88);
  --surface-inset: oklch(19% 0.013 73 / 0.72);
  --text-primary: oklch(96% 0.006 75);
  --text-secondary: oklch(82% 0.012 78);
  --text-subtle: oklch(66% 0.013 78);
  --accent-private: oklch(72% 0.105 74);
  --accent-teal-rich: oklch(44% 0.083 190);
  --accent-teal-bright: oklch(63% 0.09 202);
  --line-private: oklch(72% 0.105 74 / 0.28);
  --line-quiet: oklch(96% 0.006 75 / 0.10);
  --focus-glow: oklch(72% 0.105 74 / 0.32);
}

body {
  background:
    radial-gradient(circle at 12% -8%, oklch(47% 0.07 204 / 0.42), transparent 28rem),
    radial-gradient(circle at 86% 6%, oklch(50% 0.08 72 / 0.28), transparent 26rem),
    linear-gradient(180deg, var(--surface-warm) 0%, var(--surface-root) 54%, oklch(13% 0.012 72) 100%);
  color: var(--text-primary);
}

body::before {
  background: radial-gradient(circle, oklch(72% 0.105 74 / 0.22), oklch(52% 0.078 202 / 0.22) 38%, transparent 68%);
  filter: blur(58px);
  opacity: 0.74;
}

body::after {
  background:
    linear-gradient(112deg, transparent 0 26%, oklch(63% 0.09 202 / 0.052) 27%, transparent 38%),
    radial-gradient(circle at 78% 18%, oklch(44% 0.083 190 / 0.20), transparent 30rem),
    repeating-linear-gradient(90deg, oklch(96% 0.006 75 / 0.018) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, oklch(96% 0.006 75 / 0.014) 0 1px, transparent 1px 92px);
  opacity: 0.72;
}

.portal-header {
  background: oklch(15.5% 0.014 72 / 0.92);
  border-bottom-color: var(--line-quiet);
  box-shadow: 0 16px 46px rgb(0 0 0 / 0.22);
}

.brand-mark {
  background: linear-gradient(145deg, var(--accent-teal-rich), oklch(30% 0.062 190));
  box-shadow: 0 0 0 1px oklch(72% 0.105 74 / 0.26), 0 18px 42px oklch(44% 0.083 190 / 0.28);
}

.login-card,
.error-card,
.project-hero,
.card {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface-inset));
  border-color: var(--line-private);
  box-shadow: 0 28px 80px rgb(0 0 0 / 0.34), inset 0 1px 0 oklch(96% 0.006 75 / 0.055);
}

.login-card,
.error-card {
  width: min(100%, 560px);
}

.login-card::before,
.error-card::before,
.project-hero::before {
  background:
    linear-gradient(128deg, oklch(72% 0.105 74 / 0.095), transparent 32%, oklch(63% 0.09 202 / 0.06)),
    linear-gradient(180deg, oklch(96% 0.006 75 / 0.04), transparent 42%);
}

.login-card h1 {
  max-width: 9ch;
}

.login-assist {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-quiet);
  color: var(--text-subtle);
  font-size: 0.9rem;
  line-height: 1.45;
}

.login-assist a {
  color: var(--accent-private);
  font-weight: 800;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.login-assist a:hover,
.login-assist a:focus-visible { text-decoration: underline; }

.project-hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.82fr);
  border-radius: 1.35rem;
}

.project-title-block h1 {
  max-width: 11ch;
  text-wrap: balance;
}

.project-title-block .muted {
  color: var(--text-secondary);
  font-size: 1.08rem;
}

.project-meta-grid div,
.summary-card,
.action-group,
.mini-task-card,
.meeting-card,
.action-task-card,
.roadmap-item,
.task-row,
.file-row,
.subtask-row,
.threaded-reply,
.comment-update blockquote {
  background: oklch(96% 0.006 75 / 0.045);
  border-color: var(--line-quiet);
}

.project-meta-grid div {
  border-radius: 0.72rem;
}

.project-meta-grid span,
.summary-card p,
.mini-task-card p,
.action-task-card p,
.meeting-card p,
.task-main span,
.due-date,
.file-row small {
  color: var(--text-secondary);
}

.eyebrow,
.action-group h3,
.deliverable-group h3,
.file-group h3,
.expand-indicator,
.comment-actions a,
.text-button,
.file-row em,
.thread-label {
  color: var(--accent-private);
}

.utility-strip .text-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: 0.35rem;
}

.button {
  min-height: 46px;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button-secondary {
  background: oklch(44% 0.083 190 / 0.09);
  border-color: oklch(63% 0.09 202 / 0.42);
}

.button-secondary:hover {
  background: oklch(44% 0.083 190 / 0.16);
  border-color: oklch(72% 0.105 74 / 0.48);
}

.button:focus-visible,
a:focus-visible,
summary:focus-visible,
.text-button:focus-visible {
  outline: 3px solid var(--focus-glow);
  outline-offset: 4px;
  border-radius: 0.65rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-private);
  box-shadow: 0 0 0 4px var(--focus-glow), inset 0 1px 0 oklch(96% 0.006 75 / 0.04);
}

.summary-grid {
  grid-template-columns: minmax(240px, 1.22fr) repeat(4, minmax(180px, 1fr));
}

.summary-card {
  min-height: 11.6rem;
}

.priority-card,
.waiting-summary-card,
.health-card {
  background: linear-gradient(180deg, oklch(72% 0.105 74 / 0.115), oklch(96% 0.006 75 / 0.045));
}

.empty-state {
  background: oklch(96% 0.006 75 / 0.035);
  border: 1px solid var(--line-quiet);
  color: var(--text-subtle);
}

.quiet-state {
  border-style: solid;
  background:
    linear-gradient(90deg, oklch(72% 0.105 74 / 0.08), transparent 38%),
    oklch(96% 0.006 75 / 0.03);
}

.comment-thread {
  margin-left: 0;
  padding-left: 0.9rem;
  border-left: 1px solid var(--line-private);
}

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

@media (max-width: 760px) {
  .login-assist { align-items: flex-start; flex-direction: column; }
  .project-hero { border-radius: 1rem; }
  .project-title-block h1 { max-width: 100%; }
  .summary-card { min-height: auto; }
  .utility-strip { gap: 0.35rem 0.7rem; }
  .text-button { min-height: 44px; }
}

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

/* Impeccable anti-cardpocalypse pass: one workspace, fewer boxes */
.dashboard-redesign {
  --workspace-line: oklch(96% 0.006 75 / 0.105);
  --workspace-line-strong: oklch(72% 0.105 74 / 0.20);
  --workspace-muted-panel: oklch(96% 0.006 75 / 0.026);
}

.project-hero {
  margin-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-color: var(--workspace-line);
  box-shadow: 0 30px 90px rgb(0 0 0 / 0.30), inset 0 1px 0 oklch(96% 0.006 75 / 0.055);
}

.summary-grid {
  grid-template-columns: minmax(240px, 1.32fr) repeat(4, minmax(150px, 1fr));
  gap: 0;
  margin: 0 0 clamp(1.6rem, 4vw, 2.8rem);
  padding: 0.2rem clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--line-private);
  border-top: 0;
  border-radius: 0 0 1.35rem 1.35rem;
  background: linear-gradient(180deg, oklch(18% 0.014 73 / 0.84), oklch(15.8% 0.012 73 / 0.62));
  box-shadow: 0 22px 64px rgb(0 0 0 / 0.20);
}

.summary-card,
.summary-card.priority-card,
.summary-card.waiting-summary-card,
.summary-card.health-card {
  min-height: auto;
  padding: 1rem clamp(0.9rem, 1.7vw, 1.25rem);
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--workspace-line);
  background: transparent;
  box-shadow: none;
}

.summary-card:last-child { border-right: 0; }
.summary-card .eyebrow { margin-bottom: 0.42rem; }
.summary-card h2 { font-size: 1.05rem; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.025em; }
.summary-card p { margin-top: 0.35rem; font-size: 0.88rem; line-height: 1.42; color: var(--text-subtle); }
.summary-number { font-size: clamp(1.6rem, 3.2vw, 2.35rem); line-height: 1; font-weight: 600; letter-spacing: -0.055em; }
.summary-card .progress-track { height: 0.48rem; margin: 0.65rem 0 0.38rem; }

.focus-card {
  margin-bottom: clamp(1.7rem, 4vw, 2.8rem);
  padding: clamp(1.15rem, 2.6vw, 1.65rem);
  border-color: var(--workspace-line-strong);
  background: linear-gradient(135deg, oklch(72% 0.105 74 / 0.085), oklch(96% 0.006 75 / 0.030) 48%, oklch(44% 0.083 190 / 0.040));
  box-shadow: 0 18px 52px rgb(0 0 0 / 0.22), inset 0 1px 0 oklch(96% 0.006 75 / 0.045);
}

.dashboard-main-grid {
  grid-template-columns: minmax(230px, 0.78fr) minmax(420px, 1.58fr) minmax(240px, 0.82fr);
  gap: clamp(1.2rem, 3vw, 2rem);
  padding-top: 0.2rem;
}

.dashboard-main-grid > .card,
.dashboard-main-grid .side-stack > .card,
.lower-grid > .card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-main-grid > .card:not(:first-child),
.dashboard-main-grid .side-stack > .card,
.lower-grid > .card {
  border-top: 1px solid var(--workspace-line);
  padding-top: 1rem;
}

.side-stack {
  gap: clamp(1.4rem, 3vw, 2rem);
}

.section-header,
.section-header.compact {
  margin-bottom: 0.95rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--workspace-line);
}

.focus-card .section-header {
  border-bottom-color: var(--workspace-line-strong);
}

.roadmap-list,
.compact-task-list,
.file-group-list,
.activity-list {
  gap: 0;
}

.roadmap-item,
.task-row,
.action-task-card,
.mini-task-card,
.file-row,
.meeting-card,
.subtask-row,
.threaded-reply,
.comment-update blockquote {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.roadmap-item,
.task-row,
.mini-task-card,
.file-row,
.subtask-row {
  border-bottom: 1px solid var(--workspace-line);
}

.roadmap-item,
.file-row,
.subtask-row {
  padding: 0.78rem 0;
}

.task-row {
  padding: 0.95rem 0;
}

.task-row:hover,
.file-row:hover {
  transform: none;
  background: var(--workspace-muted-panel);
  box-shadow: none;
}

.action-group {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.action-group + .action-group,
.deliverable-group + .deliverable-group,
.file-group + .file-group {
  padding-top: 1rem;
  border-top: 1px solid var(--workspace-line);
}

.action-task-card,
.mini-task-card,
.meeting-card {
  padding: 0.85rem 0;
}

.action-task-card:not(:last-child),
.mini-task-card:not(:last-child) {
  border-bottom: 1px solid var(--workspace-line);
}

.meeting-card {
  gap: 0.55rem;
}

.comment-update {
  border-bottom: 1px solid var(--workspace-line);
  padding: 0.85rem 0;
}

.comment-update:last-child,
.roadmap-item:last-child,
.task-row:last-child,
.file-row:last-child,
.subtask-row:last-child,
.mini-task-card:last-child {
  border-bottom: 0;
}

.comment-update.needs-reply:not(.is-read),
.comment-update.is-read {
  background: transparent;
  border-color: var(--workspace-line);
}

.comment-update blockquote {
  padding: 0.15rem 0 0.15rem 0.9rem;
  border-left: 1px solid var(--workspace-line-strong);
  color: var(--text-secondary);
}

.empty-state,
.quiet-state {
  padding: 0.85rem 0;
  border: 0;
  border-top: 1px solid var(--workspace-line);
  border-radius: 0;
  background: transparent;
  color: var(--text-subtle);
}

.focus-card .empty-state,
.focus-card .quiet-state {
  padding: 0.9rem 1rem;
  border: 1px solid var(--workspace-line-strong);
  border-radius: 0.85rem;
  background: oklch(96% 0.006 75 / 0.032);
}

.lower-grid {
  gap: clamp(1.5rem, 3.2vw, 2.4rem);
  margin-top: clamp(1.7rem, 4vw, 2.8rem);
}

.bottom-actions {
  margin-top: clamp(2rem, 5vw, 3.2rem);
  padding-top: 1rem;
  border-top: 1px solid var(--workspace-line);
}

@media (max-width: 1120px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card:nth-child(2n) { border-right: 0; }
  .summary-card:nth-last-child(n + 3) { border-bottom: 1px solid var(--workspace-line); }
  .dashboard-main-grid { grid-template-columns: 1fr; }
  .dashboard-main-grid > .card,
  .dashboard-main-grid .side-stack > .card,
  .lower-grid > .card { border-top: 1px solid var(--workspace-line); padding-top: 1rem; }
}

@media (max-width: 760px) {
  .project-hero { border-radius: 1rem 1rem 0 0; }
  .summary-grid { grid-template-columns: 1fr; border-radius: 0 0 1rem 1rem; }
  .summary-card,
  .summary-card:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--workspace-line); }
  .summary-card:last-child { border-bottom: 0; }
}
