﻿:root {
  --bg: #070d1a;
  --bg-2: #0b1427;
  --bg-3: #111f37;
  --surface: #121e34;
  --surface-2: #182742;
  --surface-3: #21345a;
  --text: #edf3ff;
  --muted: #9db0d3;
  --line: #2d4069;
  --line-2: #4f6698;
  --brand: #3293ff;
  --brand-soft: #8ec3ff;
  --brand-deep: #1f6dda;
  --accent: #2dd4a7;
  --danger: #ff638d;
  --warning: #ffc166;
  --success: #52d9a8;
  --shadow-lg: 0 30px 70px rgba(2, 6, 17, 0.52);
  --shadow-md: 0 14px 34px rgba(3, 9, 22, 0.38);
  --shadow-sm: 0 8px 22px rgba(3, 10, 24, 0.28);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;
}

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

html,
body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  line-height: 1.45;
  background:
    radial-gradient(950px 560px at -8% -4%, rgba(50, 147, 255, 0.26) 0%, transparent 56%),
    radial-gradient(880px 540px at 105% 4%, rgba(45, 212, 167, 0.14) 0%, transparent 52%),
    radial-gradient(1000px 560px at 84% 110%, rgba(255, 164, 99, 0.16) 0%, transparent 56%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 52%, var(--bg-3) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

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

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

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(31, 49, 84, 0.88), rgba(22, 36, 62, 0.88));
  color: var(--text);
  padding: 0.72rem 0.86rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #95a9cf;
}

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

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.3rem;
  background-image:
    linear-gradient(180deg, rgba(31, 49, 84, 0.88), rgba(22, 36, 62, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%238ec3ff' d='m7 10l5 5l5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 0.7rem) 50%;
  background-size: auto, 16px;
}

select option {
  color: #e8f0ff;
  background: #1a2a49;
}

select[multiple] {
  padding-right: 0.86rem;
  min-height: 110px;
  background-image: linear-gradient(180deg, rgba(31, 49, 84, 0.88), rgba(22, 36, 62, 0.88));
}

input[type="file"] {
  padding: 0.35rem;
  color: #d0def8;
}

input[type="file"]::file-selector-button {
  border: 1px solid rgba(142, 195, 255, 0.58);
  background: linear-gradient(130deg, var(--brand), var(--brand-deep));
  color: #eff6ff;
  border-radius: var(--radius-xs);
  font-weight: 800;
  min-height: 38px;
  padding: 0.44rem 0.88rem;
  margin-right: 0.7rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

input[type="file"]::-webkit-file-upload-button {
  border: 1px solid rgba(142, 195, 255, 0.58);
  background: linear-gradient(130deg, var(--brand), var(--brand-deep));
  color: #eff6ff;
  border-radius: var(--radius-xs);
  font-weight: 800;
  min-height: 38px;
  padding: 0.44rem 0.88rem;
  margin-right: 0.7rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

input[type="file"]:hover::file-selector-button,
input[type="file"]:hover::-webkit-file-upload-button {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(50, 147, 255, 0.3);
  filter: brightness(1.05);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(80, 166, 255, 0.92);
  box-shadow:
    0 0 0 3px rgba(50, 147, 255, 0.2),
    0 8px 18px rgba(50, 147, 255, 0.18);
  background: linear-gradient(180deg, rgba(35, 56, 95, 0.94), rgba(23, 38, 65, 0.94));
}

.field-stack {
  display: grid;
  gap: 0.34rem;
  min-width: 0;
}

.field-stack-label {
  color: #a8c8f3;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
}

button {
  border: none;
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.project-card:focus-visible,
.stage-node:focus-visible,
.shortcut-btn:focus-visible,
.icon-btn:focus-visible {
  outline: 3px solid rgba(90, 173, 255, 0.44);
  outline-offset: 2px;
}

.sidebar-toggle-btn {
  position: fixed;
  top: auto;
  left: calc(0.72rem + env(safe-area-inset-left));
  bottom: calc(0.72rem + env(safe-area-inset-bottom));
  right: auto;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(156px, 16vw, 220px);
  min-height: 40px;
  padding: 0.48rem 0.78rem;
  border-radius: 10px;
  border: 1px solid rgba(142, 195, 255, 0.56);
  background: linear-gradient(140deg, rgba(43, 68, 117, 0.95), rgba(26, 43, 74, 0.95));
  color: #e9f4ff;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 24px rgba(7, 17, 37, 0.44);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.sidebar-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(165, 210, 255, 0.82);
  box-shadow: 0 14px 26px rgba(9, 21, 45, 0.48);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(4, 9, 20, 0.56);
  backdrop-filter: blur(2px);
}

.app-shell {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: clamp(0.7rem, 1.6vw, 1.3rem);
  display: grid;
  grid-template-columns: minmax(284px, 350px) minmax(0, 1fr);
  gap: clamp(0.8rem, 1.4vw, 1.2rem);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1900px;
}

.sidebar {
  position: sticky;
  top: clamp(0.6rem, 1vw, 1rem);
  height: calc(100vh - clamp(1.4rem, 2vw, 2.2rem));
  height: calc(100dvh - clamp(1.4rem, 2vw, 2.2rem));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(680px 460px at 95% -10%, rgba(50, 147, 255, 0.2), transparent 55%),
    linear-gradient(165deg, rgba(25, 39, 67, 0.96), rgba(18, 28, 49, 0.96));
  border: 1px solid rgba(79, 102, 152, 0.55);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(0.86rem, 1.2vw, 1.1rem);
  overflow: hidden;
}

.brand {
  padding: 0.2rem 0.1rem 0.36rem;
}

.brand-kicker {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-soft);
  font-weight: 800;
}

.brand h1 {
  margin-top: 0.28rem;
  font-size: clamp(1.24rem, 1.1rem + 0.35vw, 1.52rem);
  color: #f1f7ff;
}

.brand-subtitle {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-block {
  border-top: 1px solid rgba(79, 102, 152, 0.42);
  padding-top: 0.84rem;
  min-height: 0;
  display: grid;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.68rem;
}

.section-title h2 {
  font-size: 1.03rem;
  color: #e9f2ff;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.82rem;
  height: 1.82rem;
  border-radius: 999px;
  background: rgba(50, 147, 255, 0.2);
  border: 1px solid rgba(142, 195, 255, 0.58);
  color: #d8ebff;
  font-size: 0.79rem;
  font-weight: 800;
  padding: 0 0.5rem;
}

.project-list {
  display: grid;
  gap: 0.58rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 262px);
  max-height: calc(100dvh - 262px);
  padding-right: 0.24rem;
}

.project-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.project-list::-webkit-scrollbar-track {
  background: rgba(17, 29, 51, 0.65);
  border-radius: 999px;
}

.project-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(50, 147, 255, 0.62), rgba(33, 109, 218, 0.72));
  border-radius: 999px;
}

.project-card {
  border: 1px solid rgba(78, 104, 154, 0.58);
  border-radius: var(--radius-md);
  background: linear-gradient(148deg, rgba(30, 46, 79, 0.93), rgba(20, 33, 57, 0.93));
  padding: 0.78rem;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 0.65rem;
  align-items: center;
  color: inherit;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(142, 195, 255, 0.72);
  box-shadow: 0 10px 24px rgba(29, 109, 218, 0.26);
}

.project-card.active {
  border-color: rgba(142, 195, 255, 0.86);
  box-shadow:
    0 0 0 1px rgba(50, 147, 255, 0.32),
    0 14px 26px rgba(30, 110, 220, 0.28);
}

.project-card h4 {
  font-size: 0.95rem;
  line-height: 1.26;
  color: #eff7ff;
  word-break: break-word;
}

.project-card p {
  margin-top: 0.2rem;
  color: #b5c8ea;
  font-size: 0.8rem;
  line-height: 1.33;
  word-break: break-word;
}

.main-content {
  min-height: calc(100vh - clamp(1.4rem, 2vw, 2.2rem));
  min-height: calc(100dvh - clamp(1.4rem, 2vw, 2.2rem));
}

.empty-state {
  min-height: calc(100vh - clamp(1.4rem, 2vw, 2.2rem));
  min-height: calc(100dvh - clamp(1.4rem, 2vw, 2.2rem));
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(24, 38, 66, 0.95), rgba(16, 27, 48, 0.95));
  border: 1px solid rgba(79, 102, 152, 0.52);
  box-shadow: var(--shadow-lg);
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.45rem;
  padding: clamp(1.4rem, 3vw, 2.3rem);
}

.empty-state h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.55vw, 1.62rem);
}

.empty-state p {
  color: var(--muted);
  max-width: 60ch;
}

.workspace {
  display: grid;
  gap: clamp(0.74rem, 1.3vw, 1.1rem);
  animation: fade-up 0.32s ease;
}

.sticky-header {
  position: static;
  top: auto;
  z-index: auto;
}

.project-overview,
.stage-detail-view {
  display: grid;
  gap: clamp(0.72rem, 1.2vw, 1rem);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(0.72rem, 1.2vw, 1rem);
}

.panel {
  background:
    radial-gradient(600px 260px at 110% -14%, rgba(50, 147, 255, 0.11), transparent 56%),
    linear-gradient(160deg, rgba(24, 37, 63, 0.95), rgba(17, 28, 49, 0.95));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(79, 102, 152, 0.5);
  box-shadow: var(--shadow-md);
  padding: clamp(0.8rem, 1.3vw, 1.1rem);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.7rem, 1.2vw, 1rem);
}

.project-identity {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.identity-fields {
  min-width: 280px;
  width: min(920px, 100%);
  display: grid;
  gap: 0.5rem;
}

#projectNameInput {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.06rem, 0.98rem + 0.38vw, 1.28rem);
  font-weight: 700;
  border-color: rgba(142, 195, 255, 0.56);
  color: #eff6ff;
}

#projectDescriptionInput {
  min-height: 70px;
}

.header-side {
  display: grid;
  justify-items: end;
  gap: 0.38rem;
  flex-shrink: 0;
}

.save-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-height: 1rem;
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.save-indicator.saving {
  color: var(--warning);
}

.save-indicator.saving::before {
  content: "";
  width: 0.66rem;
  height: 0.66rem;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: 0.9;
  animation: save-spin 0.8s linear infinite;
}

.save-indicator.saved {
  color: var(--success);
  animation: save-pop 0.24s ease;
}

.save-indicator.error {
  color: var(--danger);
}

@keyframes save-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes save-pop {
  0% {
    transform: translateY(1px);
    opacity: 0.9;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.75rem;
}

.metric-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(79, 102, 152, 0.52);
  background: linear-gradient(165deg, rgba(29, 45, 78, 0.95), rgba(18, 31, 54, 0.95));
  padding: 0.84rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.metric-card h4 {
  font-size: 0.74rem;
  color: #a7c3f0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  margin-top: 0.4rem;
  font-size: clamp(1.18rem, 1rem + 0.65vw, 1.52rem);
  line-height: 1.04;
  color: #e7f2ff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.timeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.84rem;
}

.panel-title-row h3 {
  font-size: 1.03rem;
  color: #eaf4ff;
}

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

.participant-form {
  grid-template-columns: 1.3fr 1fr auto;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.62rem;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
}

.shortcut-card {
  border: 1px solid rgba(79, 102, 152, 0.58);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(28, 44, 76, 0.95), rgba(20, 33, 57, 0.95));
  padding: 0.56rem;
  display: grid;
  gap: 0.45rem;
}

.shortcut-btn {
  text-align: left;
  border: 1px solid rgba(79, 102, 152, 0.52);
  border-radius: var(--radius-md);
  padding: 0.7rem;
  background: linear-gradient(160deg, rgba(36, 56, 95, 0.95), rgba(24, 39, 66, 0.95));
  color: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.shortcut-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(142, 195, 255, 0.82);
  box-shadow: 0 10px 22px rgba(36, 113, 216, 0.26);
}

.shortcut-btn strong {
  display: block;
  font-size: 0.91rem;
  color: #eaf4ff;
}

.shortcut-btn span {
  display: block;
  margin-top: 0.2rem;
  color: #b8cce9;
  font-size: 0.79rem;
  line-height: 1.32;
}

.shortcut-remove {
  justify-self: end;
  padding: 0.35rem 0.6rem;
}

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

.mindmap-shortcut-card {
  border: 1px solid rgba(79, 102, 152, 0.58);
  border-radius: var(--radius-md);
  background: linear-gradient(152deg, rgba(28, 44, 76, 0.96), rgba(18, 31, 53, 0.96));
  padding: 0.62rem;
  display: grid;
  gap: 0.5rem;
}

.mindmap-shortcut-main {
  text-align: left;
  border: 1px solid rgba(79, 102, 152, 0.52);
  border-radius: var(--radius-md);
  padding: 0.78rem;
  background: linear-gradient(160deg, rgba(36, 56, 95, 0.95), rgba(24, 39, 66, 0.95));
  color: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.mindmap-shortcut-main:hover {
  transform: translateY(-2px);
  border-color: rgba(142, 195, 255, 0.8);
  box-shadow: 0 10px 22px rgba(36, 113, 216, 0.26);
}

.mindmap-shortcut-main strong {
  display: block;
  font-size: 0.96rem;
  color: #eaf4ff;
}

.mindmap-shortcut-main span {
  display: block;
  margin-top: 0.26rem;
  color: #b8cce9;
  font-size: 0.8rem;
  line-height: 1.35;
}

.mindmap-shortcut-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mindmap-shortcut-meta small {
  color: #9cb4dd;
  font-size: 0.75rem;
}

.mindmap-shortcut-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mindmap-editor-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.9rem;
}

.mindmap-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.mindmap-editor-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 1rem;
  margin-top: 0.24rem;
  color: #a7c1e8;
  font-size: 0.82rem;
}

.mindmap-editor-subtitle.saving {
  color: var(--warning);
}

.mindmap-editor-subtitle.saving::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: 0.9;
  animation: save-spin 0.8s linear infinite;
}

.mindmap-editor-subtitle.saved {
  color: var(--success);
}

.mindmap-editor-subtitle.error {
  color: var(--danger);
}

.mindmap-editor-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.46rem;
}

.mindmap-editor-header-actions .btn {
  min-height: 40px;
}

.mindmap-editor-toolbar {
  border: 1px solid rgba(79, 102, 152, 0.56);
  border-radius: var(--radius-md);
  background: linear-gradient(158deg, rgba(30, 47, 80, 0.95), rgba(18, 31, 54, 0.95));
  padding: 0.62rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mindmap-editor-toolbar .btn {
  min-height: 38px;
  padding: 0.56rem 0.78rem;
}

.mindmap-color-palette {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.44rem;
}

.mindmap-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(237, 243, 255, 0.65);
  box-shadow: 0 4px 12px rgba(6, 13, 28, 0.5);
  padding: 0;
}

.mindmap-color-btn:hover {
  transform: translateY(-1px);
}

.mindmap-editor-body {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 330px);
  gap: 0.8rem;
}

.mindmap-canvas-shell {
  border: 1px solid rgba(79, 102, 152, 0.58);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(230, 238, 255, 0.98), rgba(216, 231, 255, 0.98)),
    repeating-linear-gradient(
      0deg,
      rgba(131, 156, 212, 0.12) 0px,
      rgba(131, 156, 212, 0.12) 1px,
      transparent 1px,
      transparent 24px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(131, 156, 212, 0.12) 0px,
      rgba(131, 156, 212, 0.12) 1px,
      transparent 1px,
      transparent 24px
    );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  min-height: 420px;
  height: 100%;
  position: relative;
}

#mindMapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#mindMapCanvas.is-grabbing {
  cursor: grabbing;
}

.mindmap-props-panel {
  border: 1px solid rgba(79, 102, 152, 0.56);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(23, 37, 65, 0.96), rgba(16, 28, 49, 0.96));
  padding: 0.72rem;
  display: grid;
  align-content: start;
  gap: 0.5rem;
  overflow: auto;
}

.mindmap-props-panel h3 {
  color: #edf6ff;
  margin-bottom: 0.18rem;
}

.mindmap-props-panel label {
  color: #aac3e8;
  font-size: 0.82rem;
  font-weight: 700;
}

.mindmap-props-panel textarea {
  min-height: 88px;
}

.mindmap-props-panel .btn {
  width: 100%;
}

.mindmap-check {
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
  font-size: 0.84rem;
  color: #cfe2fb;
}

.mindmap-check input {
  width: auto;
  min-height: 0;
}

.link-card {
  border: 1px solid rgba(79, 102, 152, 0.54);
  background: linear-gradient(145deg, rgba(28, 44, 76, 0.96), rgba(18, 31, 53, 0.96));
  border-radius: var(--radius-md);
  padding: 0.7rem;
  display: grid;
  gap: 0.4rem;
}

.link-main {
  text-align: left;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(38, 59, 99, 0.96), rgba(24, 40, 68, 0.96));
  border: 1px solid rgba(142, 195, 255, 0.38);
  color: inherit;
  padding: 0.66rem 0.72rem;
}

.link-main strong {
  display: block;
  font-size: 0.9rem;
  color: #eaf5ff;
}

.link-main span {
  display: block;
  margin-top: 0.21rem;
  color: #bdd0eb;
  font-size: 0.79rem;
  line-height: 1.3;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.participant-list {
  display: grid;
  gap: 0.62rem;
}

.participant-chip {
  border: 1px solid rgba(79, 102, 152, 0.56);
  border-radius: var(--radius-md);
  padding: 0.68rem;
  background: linear-gradient(152deg, rgba(28, 44, 76, 0.96), rgba(18, 31, 53, 0.96));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.56rem;
  align-items: center;
}

.participant-photo-trigger {
  display: inline-flex;
  border-radius: 50%;
  cursor: pointer;
}

.participant-photo-static {
  display: inline-flex;
  border-radius: 50%;
}

.participant-photo-trigger .avatar {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.participant-photo-trigger:hover .avatar {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 2px rgba(142, 195, 255, 0.45),
    0 10px 20px rgba(45, 115, 214, 0.28);
}

.participant-chip-info {
  min-width: 0;
}

.participant-chip-info strong {
  display: block;
  color: #ebf5ff;
  word-break: break-word;
}

.participant-chip-info small {
  color: #a8c0e5;
  font-size: 0.75rem;
}

.participant-chip-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.participant-item {
  border: 1px solid rgba(79, 102, 152, 0.56);
  border-radius: var(--radius-md);
  padding: 0.66rem;
  background: linear-gradient(150deg, rgba(28, 44, 76, 0.96), rgba(18, 31, 53, 0.96));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.56rem;
  align-items: center;
}

.participant-controls {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.muted-message {
  margin: 0;
  color: #b9cde9;
  border: 1px dashed rgba(82, 111, 168, 0.62);
  border-radius: var(--radius-sm);
  background: rgba(21, 34, 58, 0.85);
  padding: 0.84rem;
  font-size: 0.86rem;
}

.stage-flow {
  display: grid;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.36rem;
}

.stage-flow::-webkit-scrollbar {
  height: 8px;
}

.stage-flow::-webkit-scrollbar-thumb {
  background: rgba(73, 102, 156, 0.72);
  border-radius: 999px;
}

.stage-flow-wrap {
  position: relative;
  display: block;
  isolation: isolate;
  min-width: fit-content;
  min-width: max-content;
}

.stage-flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.stage-connection {
  fill: none;
  stroke: rgba(98, 179, 255, 0.76);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.stage-flow-rows {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  gap: 0.95rem;
}

.stage-flow-row {
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 1vw, 0.95rem);
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.stage-flow-row.ltr {
  justify-content: flex-start;
}

.stage-flow-row.rtl {
  justify-content: flex-end;
}

.stage-slot-placeholder {
  flex: 0 0 clamp(154px, 18vw, 236px);
  max-width: clamp(154px, 18vw, 236px);
  visibility: hidden;
  pointer-events: none;
}

.stage-node {
  flex: 0 0 clamp(154px, 18vw, 236px);
  max-width: clamp(154px, 18vw, 236px);
  border: 1px solid rgba(79, 102, 152, 0.66);
  border-radius: var(--radius-md);
  background: linear-gradient(162deg, rgba(35, 54, 92, 0.98), rgba(20, 34, 58, 0.98));
  color: inherit;
  padding: 0.68rem 0.74rem;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.stage-node:hover {
  transform: translateY(-2px);
  border-color: rgba(142, 195, 255, 0.78);
  box-shadow: 0 10px 22px rgba(34, 111, 212, 0.27);
}

.stage-node small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.67rem;
  color: #8fc4ff;
}

.stage-node strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #eaf5ff;
  word-break: break-word;
}

.stage-detail-fields {
  display: grid;
  grid-template-columns: 1.2fr minmax(170px, auto);
  gap: 0.6rem;
}

.stage-detail-fields .stage-field-full {
  grid-column: 1 / -1;
}

.stage-task-form {
  grid-template-columns: 1fr 1fr auto auto auto;
}

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

.task-card {
  border: 1px solid rgba(79, 102, 152, 0.6);
  background: linear-gradient(155deg, rgba(30, 48, 82, 0.97), rgba(18, 31, 53, 0.97));
  border-radius: var(--radius-md);
  padding: 0.78rem;
  display: grid;
  gap: 0.58rem;
}

.task-card small {
  color: #a5bde2;
}

.task-responsibles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.task-responsibles.empty {
  color: #adc3e4;
  font-size: 0.8rem;
}

.additional-fields-block {
  border: 1px dashed rgba(108, 140, 203, 0.62);
  border-radius: var(--radius-sm);
  background: rgba(20, 34, 58, 0.86);
  padding: 0.58rem;
  display: grid;
  gap: 0.48rem;
}

.additional-fields-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.52rem;
}

.additional-fields-header h4 {
  margin: 0;
  font-size: 0.86rem;
  color: #d4e8ff;
}

.additional-fields-list {
  display: grid;
  gap: 0.45rem;
}

.additional-field-item {
  border: 1px solid rgba(79, 102, 152, 0.64);
  border-radius: var(--radius-xs);
  background: linear-gradient(155deg, rgba(31, 49, 83, 0.95), rgba(20, 33, 58, 0.95));
  padding: 0.54rem;
  display: grid;
  gap: 0.34rem;
}

.additional-field-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.48rem;
  flex-wrap: wrap;
}

.additional-field-label {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(142, 195, 255, 0.64);
  border-radius: 999px;
  background: rgba(50, 147, 255, 0.18);
  color: #d4eaff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 0.5rem;
}

.additional-field-remove-btn {
  min-height: 30px;
  padding: 0.3rem 0.55rem;
}

.additional-field-item p {
  margin: 0;
  color: #d8e9ff;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.responsible-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  border: 1px solid rgba(79, 102, 152, 0.62);
  border-radius: 999px;
  background: rgba(22, 36, 62, 0.9);
  padding: 0.2rem 0.48rem 0.2rem 0.22rem;
}

.responsible-pill em {
  font-style: normal;
  font-size: 0.76rem;
  color: #dce9fb;
  line-height: 1;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0.75rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: linear-gradient(180deg, rgba(98, 179, 255, 0.46), rgba(45, 212, 167, 0.18));
}

.timeline-item {
  position: relative;
  margin-left: 0.85rem;
  border: 1px solid rgba(79, 102, 152, 0.58);
  background: linear-gradient(155deg, rgba(30, 48, 82, 0.97), rgba(18, 31, 53, 0.97));
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.timeline-item::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  left: -26px;
  top: 17px;
  border: 2px solid #152541;
}

.stage-item::before {
  background: var(--brand);
  box-shadow: 0 0 0 2px rgba(98, 179, 255, 0.32);
}

.task-item::before {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(45, 212, 167, 0.3);
}

.timeline-item:hover {
  transform: translateY(-2px);
}

.timeline-item.active {
  border-color: rgba(142, 195, 255, 0.78);
  box-shadow: 0 12px 26px rgba(31, 108, 213, 0.26);
}

.timeline-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.timeline-item textarea {
  min-height: 80px;
}

.task-timeline .timeline::before,
.task-timeline.timeline::before {
  left: 18px;
  background: linear-gradient(180deg, rgba(45, 212, 167, 0.55), rgba(50, 147, 255, 0.22));
}

.status {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  min-width: 126px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  padding: 0 0.65rem;
}

.status-nao_iniciada {
  color: #ffe0b4;
  background: rgba(255, 193, 102, 0.14);
  border-color: rgba(255, 193, 102, 0.46);
}

.status-em_andamento {
  color: #cce4ff;
  background: rgba(50, 147, 255, 0.16);
  border-color: rgba(50, 147, 255, 0.58);
}

.status-concluida {
  color: #8bf3ca;
  background: rgba(82, 217, 168, 0.13);
  border-color: rgba(82, 217, 168, 0.54);
}

.status-bloqueada {
  color: #ffc2d7;
  background: rgba(255, 99, 141, 0.14);
  border-color: rgba(255, 99, 141, 0.5);
}

.avatar-upload {
  display: inline-grid;
  place-items: center;
  gap: 0.27rem;
  cursor: pointer;
}

.avatar-upload span {
  font-size: 0.74rem;
  color: #b2c9ea;
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  max-width: none;
  flex-shrink: 0;
  background: #253b62;
  border: 2px solid rgba(122, 187, 255, 0.66);
  box-shadow:
    0 0 0 2px rgba(79, 102, 152, 0.44),
    0 10px 20px rgba(3, 10, 25, 0.4);
}

.avatar-xl {
  width: 86px;
  height: 86px;
  min-width: 86px;
  min-height: 86px;
}

.avatar-md {
  width: 48px;
  height: 48px;
}

.avatar-sm {
  width: 43px;
  height: 43px;
}

.avatar-xs {
  width: 24px;
  height: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 11px;
  padding: 0.64rem 0.98rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  transition: transform 0.17s ease, opacity 0.17s ease, box-shadow 0.17s ease, border-color 0.17s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

.btn-primary {
  color: #f1f8ff;
  background: linear-gradient(130deg, var(--brand), var(--brand-deep));
  border: 1px solid rgba(142, 195, 255, 0.48);
  box-shadow: 0 12px 24px rgba(31, 109, 214, 0.34);
}

.btn-primary:hover {
  box-shadow: 0 14px 28px rgba(31, 109, 214, 0.4);
}

.btn-secondary {
  color: #eaf4ff;
  border: 1px solid rgba(79, 102, 152, 0.62);
  background: linear-gradient(150deg, rgba(38, 58, 98, 0.95), rgba(24, 39, 67, 0.95));
}

.btn-danger {
  color: #ffdce7;
  border: 1px solid rgba(255, 99, 141, 0.64);
  background: linear-gradient(160deg, rgba(101, 33, 56, 0.92), rgba(69, 23, 39, 0.92));
}

.icon-btn {
  border-radius: var(--radius-xs);
  min-height: 36px;
  padding: 0.43rem 0.66rem;
  border: 1px solid rgba(79, 102, 152, 0.68);
  background: linear-gradient(160deg, rgba(35, 54, 92, 0.96), rgba(22, 37, 62, 0.96));
  color: #e4f1ff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(142, 195, 255, 0.72);
  box-shadow: 0 8px 18px rgba(33, 112, 214, 0.26);
}

.full-width {
  width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  border: 0;
  overflow: hidden;
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  background:
    radial-gradient(760px 400px at 20% -8%, rgba(50, 147, 255, 0.24), transparent 50%),
    rgba(4, 8, 18, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 2.5vw, 1.4rem);
}

.modal-card {
  width: min(960px, 100%);
  max-height: min(94vh, 980px);
  max-height: min(94dvh, 980px);
  overflow: auto;
  background:
    radial-gradient(560px 260px at 100% 0%, rgba(50, 147, 255, 0.15), transparent 58%),
    linear-gradient(170deg, rgba(24, 38, 66, 0.98), rgba(16, 27, 47, 0.98));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(79, 102, 152, 0.64);
  box-shadow: var(--shadow-lg);
  padding: clamp(0.82rem, 1.4vw, 1.12rem);
}

.modal-card-sm {
  width: min(580px, 100%);
}

.modal-card.mindmap-editor-card {
  width: min(98vw, 1880px);
  max-width: 1880px;
  height: min(96dvh, 1300px);
  max-height: min(96dvh, 1300px);
  overflow: hidden;
  padding: clamp(0.72rem, 1vw, 0.98rem);
}

.modal-card::-webkit-scrollbar {
  width: 10px;
}

.modal-card::-webkit-scrollbar-thumb {
  background: rgba(77, 110, 172, 0.72);
  border-radius: 999px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.modal-header h2 {
  color: #edf6ff;
  font-size: clamp(1.1rem, 1rem + 0.35vw, 1.32rem);
}

.modal-form {
  display: grid;
  gap: 0.8rem;
}

.modal-section {
  border: 1px solid rgba(79, 102, 152, 0.56);
  border-radius: var(--radius-md);
  padding: 0.82rem;
  background: linear-gradient(165deg, rgba(31, 48, 82, 0.9), rgba(20, 32, 56, 0.9));
  display: grid;
  gap: 0.58rem;
}

.modal-form h3 {
  font-size: 0.95rem;
  color: #cde4ff;
}

.modal-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.modal-tip {
  color: var(--muted);
  font-size: 0.84rem;
}

.create-stages-builder {
  display: grid;
  gap: 0.75rem;
}

.create-stage-card {
  border: 1px solid rgba(142, 195, 255, 0.44);
  background: linear-gradient(155deg, rgba(34, 53, 90, 0.93), rgba(21, 35, 60, 0.93));
  border-radius: var(--radius-md);
  padding: 0.72rem;
  display: grid;
  gap: 0.64rem;
}

.create-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.create-stage-header h4 {
  color: #edf6ff;
  font-size: 0.95rem;
}

.create-stage-fields {
  display: grid;
  grid-template-columns: 1.08fr 1.22fr auto;
  gap: 0.5rem;
}

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

.create-task-card {
  border: 1px solid rgba(79, 102, 152, 0.62);
  background: linear-gradient(160deg, rgba(29, 45, 77, 0.9), rgba(18, 31, 53, 0.9));
  border-radius: var(--radius-sm);
  padding: 0.62rem;
  display: grid;
  gap: 0.45rem;
}

.create-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.create-task-header strong {
  color: #dcecff;
  font-size: 0.86rem;
}

.create-add-task-btn {
  width: fit-content;
}

.modal-actions {
  margin-top: 0.25rem;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.toast-host {
  position: fixed;
  z-index: 40;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 0.55rem;
}

.toast {
  min-width: 250px;
  max-width: min(390px, calc(100vw - 2rem));
  border-radius: 12px;
  border: 1px solid rgba(79, 102, 152, 0.66);
  background: linear-gradient(165deg, rgba(31, 48, 82, 0.97), rgba(20, 32, 56, 0.97));
  color: #edf6ff;
  box-shadow: var(--shadow-md);
  padding: 0.74rem 0.85rem;
  animation: fade-up 0.22s ease;
}

.toast.info {
  border-left: 4px solid var(--brand);
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.hidden {
  display: none !important;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports not (width: min(100%, 10px)) {
  .app-shell {
    width: 100%;
    max-width: 1800px;
    padding: 1rem;
    gap: 1rem;
    grid-template-columns: 320px 1fr;
  }

  .sidebar {
    top: 1rem;
    height: calc(100vh - 2rem);
    padding: 1rem;
  }

  .main-content,
  .empty-state {
    min-height: calc(100vh - 2rem);
  }

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

  .stage-node,
  .stage-slot-placeholder {
    flex: 0 0 210px;
    max-width: 210px;
  }

  .modal {
    padding: 1rem;
  }

  .modal-card {
    max-height: 94vh;
  }
}

@supports not (display: grid) {
  .app-shell,
  .workspace,
  .project-overview,
  .stage-detail-view,
  .overview-grid,
  .metrics-grid,
  .shortcut-grid,
  .participant-list,
  .task-list,
  .modal-form,
  .create-stages-builder {
    display: block;
  }

  .panel,
  .metric-card,
  .shortcut-card,
  .participant-chip,
  .task-card,
  .create-stage-card {
    margin-bottom: 0.75rem;
  }
}

@media (min-width: 1201px) {
  .app-shell.sidebar-collapsed .sidebar {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

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

  .panel,
  .sidebar {
    border-radius: 26px;
  }
}

@media (max-width: 1540px) {
  .metrics-grid {
    grid-template-columns: repeat(4, minmax(132px, 1fr));
  }

  .overview-grid,
  .dashboard-grid,
  .timeline-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(340px, 88vw);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    gap: 0.85rem;
    border-radius: 0 22px 22px 0;
    z-index: 52;
    transform: translateX(-108%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-block {
    padding-top: 0.72rem;
  }

  .project-list {
    max-height: calc(100vh - 250px);
    max-height: calc(100dvh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    grid-auto-flow: row;
    grid-auto-columns: unset;
    padding-bottom: 0;
  }

  .project-card {
    min-height: 0;
  }

  .main-content,
  .empty-state {
    min-height: auto;
  }

  .sticky-header {
    position: static;
  }
}

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

  .project-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-side {
    justify-items: start;
  }

  .save-indicator {
    text-align: left;
  }

  .stage-flow-svg {
    display: none;
  }

  .mindmap-editor-body {
    grid-template-columns: 1fr;
  }

  .mindmap-canvas-shell {
    min-height: 420px;
    height: min(62vh, 620px);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0.65rem;
    gap: 0.65rem;
  }

  .sidebar-toggle-btn {
    top: auto;
    left: calc(0.58rem + env(safe-area-inset-left));
    bottom: calc(0.58rem + env(safe-area-inset-bottom));
    width: clamp(148px, 46vw, 206px);
    min-height: 38px;
    padding: 0.44rem 0.7rem;
    font-size: 0.84rem;
  }

  .sidebar,
  .panel,
  .empty-state,
  .modal-card {
    border-radius: 18px;
  }

  .project-list {
    grid-auto-columns: minmax(210px, 76vw);
  }

  .sidebar {
    width: min(320px, 90vw);
    border-radius: 0 18px 18px 0;
  }

  .project-identity {
    flex-direction: column;
    align-items: flex-start;
  }

  .identity-fields {
    min-width: 100%;
    width: 100%;
  }

  .avatar-xl {
    width: 74px;
    height: 74px;
    min-width: 74px;
    min-height: 74px;
  }

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

  .shortcut-grid,
  .link-grid,
  .mindmap-shortcut-grid {
    grid-template-columns: 1fr;
  }

  .panel-title-row {
    align-items: stretch;
  }

  .panel-title-row .btn,
  .panel-title-row .icon-btn {
    width: 100%;
  }

  .participant-chip,
  .participant-item {
    grid-template-columns: auto 1fr;
  }

  .participant-chip-actions,
  .participant-controls {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .stage-detail-fields,
  .stage-task-form,
  .form-grid,
  .participant-form,
  .create-stage-fields {
    grid-template-columns: 1fr;
  }

  .stage-node,
  .stage-slot-placeholder {
    flex: 0 0 min(240px, 70vw);
    max-width: min(240px, 70vw);
  }

  .modal {
    place-items: end center;
    padding: 0.45rem;
  }

  .modal-card {
    width: 100%;
    max-height: 93vh;
    max-height: 93dvh;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
  }

  .mindmap-editor-card {
    padding: 0.68rem;
    gap: 0.68rem;
    max-height: 98vh;
    max-height: 98dvh;
  }

  .modal-card.mindmap-editor-card {
    width: 100%;
    height: 98dvh;
    max-height: 98dvh;
    overflow: hidden;
  }

  .mindmap-editor-header {
    flex-direction: column;
  }

  .mindmap-editor-header-actions {
    width: 100%;
  }

  .mindmap-editor-header-actions .btn {
    width: 100%;
  }

  .mindmap-editor-toolbar {
    gap: 0.38rem;
  }

  .mindmap-editor-toolbar .btn {
    width: calc(50% - 0.2rem);
  }

  .mindmap-color-palette {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .modal-inline-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-actions {
    justify-content: flex-start;
  }

  .modal-actions .btn,
  .modal-actions .icon-btn {
    width: 100%;
  }

  .toast-host {
    right: 10px;
    left: 10px;
    bottom: 10px;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 680px) {
  .header-side {
    width: 100%;
    justify-items: stretch;
  }

  .header-side .btn {
    width: 100%;
  }

  .save-indicator {
    width: 100%;
  }

  .panel-title-row h3 {
    width: 100%;
  }

  .stage-node,
  .stage-slot-placeholder {
    flex: 0 0 min(220px, 76vw);
    max-width: min(220px, 76vw);
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 0.56rem;
  }

  .project-list {
    grid-auto-columns: minmax(180px, 84vw);
  }

  .brand h1 {
    line-height: 1.15;
  }

  .panel-title-row {
    margin-bottom: 0.7rem;
  }
}

@media (max-height: 760px) and (orientation: landscape) {
  .modal {
    place-items: center;
    padding: 0.55rem;
  }

  .modal-card {
    max-height: 88vh;
    max-height: 88dvh;
  }
}

@media (hover: none) {
  .btn:hover,
  .icon-btn:hover,
  .sidebar-toggle-btn:hover,
  .project-card:hover,
  .stage-node:hover,
  .shortcut-btn:hover,
  .timeline-item:hover {
    transform: none;
    box-shadow: inherit;
  }
}

@media (max-width: 520px) {
  body {
    line-height: 1.4;
  }

  .brand-subtitle {
    font-size: 0.85rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .status {
    min-width: 112px;
    font-size: 0.68rem;
  }

  .timeline-item-top {
    align-items: stretch;
  }

  .timeline-item-top .icon-btn {
    width: 100%;
  }

  .task-card {
    padding: 0.68rem;
  }

  .sidebar-toggle-btn {
    top: auto;
    left: calc(0.5rem + env(safe-area-inset-left));
    bottom: calc(0.5rem + env(safe-area-inset-bottom));
    width: clamp(144px, 50vw, 190px);
    min-height: 36px;
    padding: 0.42rem 0.62rem;
    font-size: 0.8rem;
  }

  .btn,
  .icon-btn,
  input,
  textarea,
  select {
    font-size: 0.95rem;
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding: 0.5rem;
  }

  .sidebar,
  .panel,
  .empty-state {
    padding: 0.72rem;
  }

  .project-list {
    grid-auto-columns: minmax(180px, 80vw);
  }

  .project-card {
    grid-template-columns: 40px 1fr;
    padding: 0.66rem;
  }

  .avatar-sm {
    width: 38px;
    height: 38px;
  }

  .toast {
    padding: 0.66rem 0.72rem;
  }
}
