@font-face {
  font-family: fontPrimary;
  src: url(/_next/static/media/59cd631ad8981a60-s.p.woff2) format("woff2");
  font-display: swap;
  font-weight: 500;
  font-style: medium;
}

@font-face {
  font-family: fontPrimary;
  src: url(/_next/static/media/b774e7b62f9109dd-s.p.woff2) format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: fontPrimary Fallback;
  src: local("Arial");
  ascent-override: 111.53%;
  descent-override: 52.82%;
  line-gap-override: 0.00%;
  size-adjust: 105.26%;
}

:root {
  --font-primary:
    "Avenir Next Condensed",
    "Futura",
    "Franklin Gothic Medium",
    "Trebuchet MS",
    sans-serif;
  --bg: #e7dfd2;
  --surface: #f4efe6;
  --ink: #0f0f0f;
  --muted: #3b342f;
  --line: #0f0f0f;
  --accent: #0f0f0f;
  --accent-strong: #0a0a0a;
  --paper: #f4efe6;
  --shadow: none;
  --radius-card: 0;
  --radius-soft: 0;
  --radius-pill: 999px;
  --vision: #a23a36;
  --vision-accent: #0f0f0f;
  --vision-glow: rgba(162, 58, 54, 0.35);
  --goal: #b07ad6;
  --goal-accent: #0f0f0f;
  --goal-glow: rgba(176, 122, 214, 0.35);
  --idea: #f49ccd;
  --idea-accent: #0f0f0f;
  --idea-glow: rgba(244, 156, 205, 0.35);
  --project: #f3a369;
  --project-accent: #0f0f0f;
  --project-glow: rgba(243, 163, 105, 0.35);
  --milestone: #58c3aa;
  --milestone-accent: #0f0f0f;
  --milestone-glow: rgba(88, 195, 170, 0.35);
  --module: #7bd5e2;
  --module-accent: #0f0f0f;
  --module-glow: rgba(123, 213, 226, 0.35);
  --task: #f4efe6;
  --task-accent: #0f0f0f;
  --task-glow: rgba(244, 239, 230, 0.35);
}

* {
  box-sizing: border-box;
}

body * {
  box-shadow: none !important;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(10, 10, 10, 0.06), transparent 40%),
    radial-gradient(circle at 12% 18%, rgba(0, 0, 0, 0.08), transparent 46%),
    #e7dfd2;
  min-height: 100vh;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  border: 4px solid var(--line);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.modal-overlay.active {
  display: flex;
}

.work-overlay {
  padding: 24px;
}

.work-embed {
  position: relative;
  width: min(1200px, 94vw);
  height: min(760px, 90vh);
  background: var(--paper);
  border-radius: 28px;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.work-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
}

.work-close {
  position: absolute;
  right: 18px;
  top: 16px;
  z-index: 2;
}

.work-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px;
  gap: 20px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}

.work-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 3px solid var(--line);
  padding-bottom: 14px;
}

.work-panel-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.work-panel-header h2 {
  margin: 6px 0 0;
  font-family: var(--font-primary);
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.work-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 10px;
  color: var(--muted);
}

.work-timer {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  min-width: 80px;
}

.work-timer strong {
  display: block;
  font-size: 22px;
  color: var(--ink);
}

.work-account-progress {
  min-width: 280px;
  max-width: 400px;
  flex: 1;
}

.work-account-progress .account-progress-header {
  gap: 10px;
}

.work-account-progress .account-xp {
  font-size: 10px;
}

.work-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  padding: 0;
  background: transparent;
  border: 0;
  margin-left: auto;
}

.work-panel-header .work-close {
  position: static;
}

.work-panel-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.work-notes,
.work-tasks,
.work-task-detail {
  border: 3px solid var(--line);
  padding: 16px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.work-notes textarea {
  flex: 1;
  min-height: 180px;
  border: 2px solid var(--line);
  background: #fff;
  padding: 12px;
  font-family: var(--font-primary);
  resize: vertical;
}

.work-tasks-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.work-task-input {
  display: flex;
  gap: 8px;
}

.work-task-input input {
  flex: 1;
  border: 2px solid var(--line);
  padding: 10px;
  font-family: var(--font-primary);
}

.work-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 6px;
}

.work-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--line);
  padding: 8px 10px;
  background: #fff;
}

.work-task-item.done {
  opacity: 0.6;
  text-decoration: line-through;
}

.work-task-item input {
  width: 16px;
  height: 16px;
}

.work-task-title {
  flex: 1;
  font-size: 14px;
}

.work-task-empty {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px dashed var(--line);
  padding: 14px;
  text-align: center;
}

.work-task-item.active {
  background: var(--vision);
  color: #fff;
}

.work-task-detail {
  border: 3px solid var(--line);
  padding: 16px;
  background: var(--paper);
  display: none;
  flex-direction: column;
  gap: 12px;
}

.work-task-detail .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-task-detail .field span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.work-task-detail input,
.work-task-detail textarea,
.work-task-detail select {
  border: 2px solid var(--line);
  padding: 8px 10px;
  font-family: var(--font-primary);
  font-size: 14px;
  background: #fff;
  min-width: 200px;
  width: 100%;
  box-sizing: border-box;
}

.work-task-detail textarea {
  resize: vertical;
  min-height: 80px;
}

.work-task-detail select {
  cursor: pointer;
}

.xp-pixel {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--project);
  border: 1px solid var(--line);
  z-index: 20;
  pointer-events: none;
  animation: xp-pixel-flow 0.85s ease-out forwards;
}

@keyframes xp-pixel-flow {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.6);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .work-panel {
    padding: 22px;
  }

  .work-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .work-panel-header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .work-account-progress {
    flex: 1 1 280px;
    min-width: 240px;
    max-width: 100%;
  }

  .work-panel-body {
    grid-template-columns: 1fr;
  }
}

body.work-mode-open {
  overflow: hidden;
}

.modal {
  width: min(520px, 92vw);
  background: var(--paper);
  border-radius: 0;
  padding: 22px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 4px solid var(--line);
}

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

.modal-header h2 {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.confirm-actions {
  gap: 10px;
}

.confirm-title {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.confirm-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.auth-message {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.auth-actions {
  justify-content: space-between;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

#open-auth {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

#open-auth:hover,
#open-auth:active {
  transform: none;
}

.meditation-button {
  padding: 4px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.meditation-button img {
  width: 18px;
  height: 18px;
  display: block;
}

.meditation-modal .modal-body {
  padding-top: 8px;
}

.meditation-content p {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.6;
}

.meditation-content ul {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
}

.meditation-content strong {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
}

.auth-email {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.progress-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-family: var(--font-primary);
}

.progress-track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  height: 12px;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0.08));
  border: 2px solid rgba(15, 15, 15, 0.65);
  overflow: hidden;
  --progress-hue: 45;
}

.progress-segment {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.12));
  border-radius: 999px;
  border: 1px solid rgba(15, 15, 15, 0.2);
  transition: background 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-segment.done {
  background: linear-gradient(
    90deg,
    hsl(var(--progress-hue) 88% 60%),
    hsl(var(--progress-hue) 82% 48%)
  );
  border-color: rgba(15, 15, 15, 0.35);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--paper);
  border-bottom: 4px solid var(--line);
  backdrop-filter: none;
  position: sticky;
  top: 0;
  z-index: 6;
}

.account-progress {
  justify-self: center;
  width: 100%;
  min-width: 0;
  border: 3px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: none;
}

.account-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-level {
  padding: 6px 10px;
  border: 3px solid var(--line);
  background: var(--project);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  font-weight: 700;
}

.account-xp {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.account-xp-total {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.account-xp-next {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.account-progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0.08));
  border: 2px solid rgba(15, 15, 15, 0.65);
  overflow: hidden;
}

.account-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    hsl(var(--xp-hue, 45) 88% 60%),
    hsl(var(--xp-hue, 45) 82% 48%)
  );
  border-radius: inherit;
  border: 1px solid rgba(15, 15, 15, 0.35);
  position: relative;
  transition: width 0.5s ease;
}

.account-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.45) 40%, transparent 70%);
  opacity: 0.6;
  animation: xp-shimmer 2.2s ease-in-out infinite;
}

@keyframes xp-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.topbar-left {
  justify-self: start;
}

.topbar-actions {
  justify-self: end;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1 1 360px;
  min-width: 260px;
}

.top-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  max-width: 520px;
  flex: 1 1 320px;
}

.top-slots .slot-title {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 0;
  color: var(--muted);
}

.top-slots .slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 6px;
}

.top-slots .slot {
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 0;
  background: #fff;
  border: 3px solid var(--line);
  gap: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}



.top-slots .slot-name {
  font-size: 12px;
  font-weight: 600;
}

.top-slots .slot-meta {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.top-slots .slot.empty {
  color: var(--muted);
  align-items: flex-start;
  gap: 6px;
}

.top-slots .slot-change {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 0;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.top-slots .slot-remove {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 0;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.top-slots .slot-finish {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 6px;
  border-radius: 0;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: grid;
  place-items: center;
}

.top-slots .slot-select {
  width: 100%;
  border-radius: 0;
  border: 2px solid var(--line);
  background: #fff;
  padding: 4px 6px;
  font-size: 10px;
}

.top-slots .slot-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.top-slots .slot-add,
.top-slots .slot-cancel {
  padding: 4px 6px;
  border-radius: 0;
  font-size: 10px;
  border: 2px solid var(--line);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 0;
  background: var(--accent);
  color: white;
  font-family: var(--font-primary);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: none;
}

.brand-title {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 18px;
}

.brand-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-self: center;
}

.sync-status {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  color: #1d1d1d;
  background: rgba(0, 0, 0, 0.04);
}

.sync-status.sync-on {
  border: none;
  color: #14683a;
  background: rgba(20, 120, 60, 0.12);
}

.sync-status.sync-off {
  border: none;
  color: #9b2b2b;
  background: rgba(155, 43, 43, 0.12);
}

button {
  font-family: var(--font-primary);
  border: none;
  border-radius: 0;
  padding: 9px 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

button.primary {
  background: var(--accent);
  color: white;
}

button.danger {
  background: #9b2b2b;
  color: #fff;
}

button.rainbow {
  background: var(--accent);
  color: white;
  border: 3px solid var(--line);
}

button.ghost {
  background: transparent;
  border: 3px solid var(--line);
  color: var(--ink);
}

.tree-panel,
.detail-panel,
.modal,
.module-card,
.node,
.top-slots .slot,
.control {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

button:active {
  transform: translateY(0);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(46, 109, 232, 0.4);
  outline-offset: 2px;
}

.layout {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 18px 22px 26px;
  flex: 1;
}

body.ai-manager-open .layout {
  grid-template-columns: 30px 1fr 320px;
}

body.ai-manager-open .ai-manager {
  display: flex;
}

body.idea-space-open .layout {
  grid-template-columns: 30px 1fr 320px;
}

body.idea-space-open .idea-space {
  display: flex;
}

body:not(.project-view) .layout {
  grid-template-columns: 1fr;
  padding-left: 32px;
  padding-right: 32px;
}

body:not(.project-view) .controls {
  display: none;
}

body.ai-manager-open:not(.project-view) .layout {
  grid-template-columns: 1fr 320px;
}

body.ai-manager-open:not(.project-view) .controls {
  display: none;
}

body.idea-space-open:not(.project-view) .layout {
  grid-template-columns: 1fr 320px;
}

body.idea-space-open:not(.project-view) .controls {
  display: none;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
}

.idea-space {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--paper);
  border: 4px solid var(--line);
  min-width: 260px;
  max-width: 360px;
  height: calc(100vh - 140px);
  min-height: 400px;
  max-height: calc(100vh - 140px);
  position: sticky;
  top: 92px;
  align-self: start;
}

.idea-space-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.idea-space-label {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.idea-space-header h3 {
  margin: 4px 0 0;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.idea-space-actions {
  display: flex;
  gap: 8px;
}

.idea-space-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.idea-card {
  border: 3px solid var(--line);
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
}

.idea-card:active {
  cursor: grabbing;
}

.idea-card-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.idea-card-meta {
  font-size: 11px;
  color: var(--muted);
}

.idea-card-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.idea-card button {
  align-self: flex-start;
  padding: 4px 8px;
  font-size: 10px;
}

.idea-space-empty {
  border: 3px dashed var(--line);
  padding: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.quick-tasks {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--paper);
  border: 4px solid var(--line);
  min-width: 260px;
  max-width: 360px;
  height: calc(100vh - 140px);
  min-height: 400px;
  max-height: calc(100vh - 140px);
  position: sticky;
  top: 92px;
  align-self: start;
}

body.quick-tasks-open .layout {
  grid-template-columns: 30px 1fr 320px;
}

body.quick-tasks-open .quick-tasks {
  display: flex;
}

body:not(.project-view) .layout {
  grid-template-columns: 1fr;
  padding-left: 32px;
  padding-right: 32px;
}

body:not(.project-view) .controls {
  display: none;
}

body.quick-tasks-open:not(.project-view) .layout {
  grid-template-columns: 1fr 320px;
}

body.quick-tasks-open:not(.project-view) .controls {
  display: none;
}

.quick-tasks-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.quick-tasks-label {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.quick-tasks-header h3 {
  margin: 4px 0 0;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.quick-tasks-actions {
  display: flex;
  gap: 8px;
}

.quick-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.quick-task-card {
  border: 3px solid var(--line);
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.quick-task-card:hover {
  transform: translateX(-2px);
}

.quick-task-card.done {
  opacity: 0.6;
  text-decoration: line-through;
  border-color: var(--milestone);
  background: rgba(88, 195, 170, 0.2);
}

.quick-task-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.quick-task-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.quick-task-difficulty {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border: 2px solid var(--line);
  background: var(--project);
}

.quick-task-difficulty.easy {
  background: var(--milestone);
}

.quick-task-difficulty.medium {
  background: var(--project);
}

.quick-task-difficulty.hard {
  background: var(--goal);
}

.quick-task-difficulty.impossible {
  background: var(--vision);
}

.quick-task-xp {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-left: auto;
}

.quick-task-recurrence {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
}

.quick-task-repeat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.quick-task-repeat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.quick-task-repeat-toggle input {
  margin: 0;
}

.quick-task-repeat select {
  border: 2px solid var(--line);
  padding: 6px 10px;
  font-family: var(--font-primary);
  font-size: 12px;
  background: #fff;
  cursor: pointer;
}

.quick-task-repeat select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.quick-task-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.quick-task-card button {
  align-self: flex-start;
  padding: 4px 8px;
  font-size: 10px;
}

.quick-tasks-empty {
  border: 3px dashed var(--line);
  padding: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.ai-manager {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--paper);
  border: 4px solid var(--line);
  min-width: 260px;
  max-width: 360px;
  height: calc(100vh - 140px);
  min-height: 400px;
  max-height: calc(100vh - 140px);
  position: sticky;
  top: 92px;
  align-self: start;
}

.ai-manager-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.ai-manager-label {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.ai-manager-header h3 {
  margin: 4px 0 0;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ai-manager-actions {
  display: flex;
  gap: 8px;
}

.ai-manager-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.ai-manager-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-manager-form .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-manager-form label.field span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.ai-manager-form select,
.ai-manager-form textarea,
.ai-manager-form input {
  border: 2px solid var(--line);
  padding: 8px 10px;
  font-family: var(--font-primary);
  font-size: 12px;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.ai-manager-form textarea {
  resize: vertical;
  min-height: 100px;
}

.ai-manager-form select {
  cursor: pointer;
}

.ai-manager-form button {
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.ai-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
  min-height: 16px;
}

.ai-status.loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-top-color: transparent;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.ai-status.success {
  color: #14683a;
}

.ai-status.error {
  color: #9b2b2b;
}

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

.ai-key-notice {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ai-manager-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.ai-manager-empty {
  border: 3px dashed var(--line);
  padding: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.ai-results-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-results-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 2px solid var(--line);
}

.ai-result-card {
  border: 3px solid var(--line);
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-result-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ai-result-count {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.difficulty-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.difficulty-btn {
  padding: 10px 12px;
  border: 3px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: all 0.15s ease;
}

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

.difficulty-btn.selected {
  background: var(--project);
  color: white;
  transform: translateY(-1px);
}

.difficulty-btn[data-difficulty='easy'].selected {
  background: var(--milestone);
}

.difficulty-btn[data-difficulty='medium'].selected {
  background: var(--project);
}

.difficulty-btn[data-difficulty='hard'].selected {
  background: var(--goal);
}

.difficulty-btn[data-difficulty='impossible'].selected {
  background: var(--vision);
}

.control {
  width: 46px;
  height: 46px;
  border-radius: 0;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: none;
}

.control-hint {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
}

.tree-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
  border-radius: 0;
  padding: 8px 0;
  box-shadow: none;
  overflow: hidden;
  border: none;
}

.tree-header {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.tree-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.action-progress {
  width: 100%;
  min-width: 0;
  max-width: 520px;
}

.tree-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.order-vision {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 0;
}

.levels-modal-title {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 600;
}

.levels-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.levels-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  align-items: center;
}

.levels-name {
  font-size: 13px;
  color: var(--ink);
}

.levels-track {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  height: 10px;
}

.levels-segment {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0;
}

.levels-segment.done {
  background: var(--ink);
}
.level-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 0;
  background: var(--vision);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.level-sub {
  font-size: 13px;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 8px;
  font-size: 11px;
  flex-wrap: wrap;
}

.legend-item {
  padding: 6px 10px;
  border-radius: 0;
  background: transparent;
  border: 3px solid var(--line);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  box-shadow: none;
}

.legend-item.vision { background: var(--vision); }
.legend-item.goal { background: var(--goal); }
.legend-item.project { background: var(--project); }
.legend-item.milestone { background: var(--milestone); }
.legend-item.module { background: var(--module); }

.tree-stage {
  position: relative;
  flex: 1;
  border-radius: 0;
  background: #f7f2ea;
  border: 4px solid var(--line);
  padding: 26px 18px;
  overflow: hidden;
  pointer-events: auto;
}

.vision-globe {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 3px solid var(--line);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), transparent 45%),
    radial-gradient(circle at 70% 75%, rgba(0, 0, 0, 0.2), transparent 55%),
    radial-gradient(circle at 50% 50%, #2e78a6 0%, #1c4f75 55%, #123852 100%);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12), inset -4px -6px 0 rgba(0, 0, 0, 0.18);
  cursor: pointer;
  z-index: 5;
  overflow: hidden;
}

.vision-globe[data-mode='archived'] {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.75), transparent 45%),
    radial-gradient(circle at 70% 75%, rgba(0, 0, 0, 0.22), transparent 55%),
    radial-gradient(circle at 50% 50%, #3c6a7a 0%, #284553 55%, #1b2f38 100%);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12), inset -4px -6px 0 rgba(0, 0, 0, 0.2);
}

.vision-globe::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(18px 14px at 22% 45%, rgba(71, 146, 88, 0.95) 0%, rgba(71, 146, 88, 0.95) 35%, transparent 36%),
    radial-gradient(12px 10px at 42% 28%, rgba(64, 132, 78, 0.95) 0%, rgba(64, 132, 78, 0.95) 38%, transparent 39%),
    radial-gradient(16px 12px at 62% 55%, rgba(80, 156, 96, 0.95) 0%, rgba(80, 156, 96, 0.95) 36%, transparent 37%),
    radial-gradient(10px 8px at 70% 38%, rgba(58, 124, 72, 0.95) 0%, rgba(58, 124, 72, 0.95) 40%, transparent 41%),
    radial-gradient(8px 6px at 34% 66%, rgba(98, 176, 108, 0.95) 0%, rgba(98, 176, 108, 0.95) 42%, transparent 43%);
  opacity: 0.95;
  mix-blend-mode: screen;
}

.vision-globe::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 60% 25%, rgba(255, 255, 255, 0.6), transparent 38%),
    radial-gradient(circle at 35% 70%, rgba(255, 255, 255, 0.45), transparent 40%);
  pointer-events: none;
  opacity: 0.8;
}

.vision-globe:focus-visible {
  outline: 3px solid var(--line);
  outline-offset: 2px;
}

.globe-edge {
  stroke-dasharray: 6 6;
}

.globe-firework {
  position: absolute;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 6;
  animation: globe-firework-fade 0.9s ease-out forwards;
}

.globe-firework-pixel {
  position: absolute;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  transform: translate(0, 0) scale(1);
  animation: globe-firework-pop 0.9s ease-out forwards;
}

@keyframes globe-firework-pop {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.9); }
}

@keyframes globe-firework-fade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.levels {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 72px;
  z-index: 4;
  pointer-events: auto;
}

.level-row {
  --stage: var(--accent);
  --stage-soft: rgba(21, 21, 21, 0.08);
}

.level-row[data-level='VISION'] { --stage: var(--vision-accent); --stage-soft: var(--vision); }
.level-row[data-level='GOAL'] { --stage: var(--goal-accent); --stage-soft: var(--goal); }
.level-row[data-level='PROJECT'] { --stage: var(--project-accent); --stage-soft: var(--project); }
.level-row[data-level='MILESTONE'] { --stage: var(--milestone-accent); --stage-soft: var(--milestone); }
.level-row[data-level='MODULE'] { --stage: var(--module-accent); --stage-soft: var(--module); }
.level-row[data-level='TASK'] { --stage: var(--task-accent); --stage-soft: var(--task); }

.level-row[data-level='VISION'] .nodes {
  flex: 1;
  justify-content: space-between;
  align-content: space-between;
  min-height: clamp(120px, 20vh, 260px);
}

.levels.project-view .level-row {
  align-items: center;
}

.levels.project-view .level-row[data-level='MILESTONE'] {
  position: relative;
  padding: 14px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.levels.project-view .level-row[data-level='MILESTONE'] .nodes {
  position: relative;
  flex-wrap: wrap;
  overflow-x: hidden;
  padding: 18px 12px;
  gap: 10px;
}

.levels.project-view .level-row[data-level='MILESTONE'] .nodes::before {
  content: none;
}

.levels.project-view .level-row[data-level='MILESTONE'] .node {
  position: relative;
  z-index: 1;
  min-width: 100px;
  padding: 10px 12px;
  font-size: 12px;
}

.levels.project-view .level-row[data-level='MODULE'] {
  padding: 0 12px 8px;
}

.levels.project-view .level-row[data-level='MODULE'] .nodes {
  gap: 18px;
}

.levels.project-view .level-row[data-level='MODULE'] .node,
.levels.project-view .level-row[data-level='TASK'] .node {
  min-width: 110px;
  padding: 10px 12px;
  font-size: 12px;
}

.module-card {
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--module);
  padding: 12px 12px 14px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: none;
}

.module-head {
  width: 100%;
  text-align: left;
}

.module-time {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.module-time-goal-track {
  position: relative;
  height: 6px;
  border-radius: 0;
  background: rgba(18, 18, 18, 0.2);
  overflow: hidden;
}

.module-time-goal-fill {
  height: 100%;
  border-radius: inherit;
  background: rgba(18, 18, 18, 0.8);
  width: 0%;
}

.module-time-goal-fill.over {
  background: rgba(17, 17, 17, 0.85);
}

.module-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.module-actions .module-work {
  padding: 6px 10px;
  font-size: 12px;
}

.module-actions .module-work.disabled {
  opacity: 0.6;
}

.work-mode-toast {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 3px solid var(--line);
  background: #fff8d5;
  color: var(--ink);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.work-mode-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.module-time-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.module-time-track {
  position: relative;
  height: 8px;
  border-radius: 0;
  background: rgba(18, 18, 18, 0.2);
  overflow: hidden;
}

.module-time-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--module), rgba(15, 15, 15, 0.4));
}

.module-progress-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  height: 6px;
}

.module-progress-segment {
  border-radius: 0;
  background: rgba(0, 0, 0, 0.22);
}

.module-progress-segment.done {
  background: rgba(0, 0, 0, 0.6);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-item {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-item.active {
  color: var(--project-accent);
}

.task-add {
  border: 3px dashed var(--line);
  border-radius: 0;
  background: transparent;
  padding: 6px 8px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.task-item::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(18, 18, 18, 0.4);
  display: inline-block;
  box-sizing: border-box;
}

.task-item[data-status='DONE']::before {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.7);
}

.task-item[data-status='ACTIVE']::before {
  background: rgba(0, 0, 0, 0.2);
}

.task-item[data-status='BLOCKED']::before,
.task-item[data-status='PAUSED']::before {
  border-style: dashed;
}

.levels.project-view .node.active {
  transform: scale(1.04);
  z-index: 2;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.level-label {
  width: 160px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--muted);
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-label::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 0;
  background: var(--stage);
  box-shadow: 0 0 0 4px rgba(18, 18, 18, 0.08);
}

.nodes {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 72px;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.reset-view {
  position: fixed;
  right: 28px;
  bottom: 24px;
  padding: 10px 18px;
  border-radius: 0;
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
  z-index: 8;
  border: 3px solid var(--line);
}

.add-vision-inline {
  align-self: center;
}

.add-node-btn {
  margin-left: auto;
  align-self: center;
  padding: 7px 12px;
  border-radius: 0;
  background: transparent;
  border: 3px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.add-node-btn:hover {
  background: rgba(18, 18, 18, 0.06);
}

.node {
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  border: 3px solid var(--line);
  font-family: var(--font-primary);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  position: relative;
  z-index: 6;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.node-label {
  display: block;
  padding-right: 22px;
  pointer-events: none;
}

.node-meta {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.node-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: rgba(18, 18, 18, 0.75);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 7;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.node-delete::before {
  content: '×';
}

.node-delete:hover {
  background: rgba(255, 255, 255, 0.95);
  color: rgba(18, 18, 18, 0.9);
  transform: scale(1.05);
}

.node-delete:focus {
  outline: 2px solid var(--line);
  outline-offset: 1px;
}

.node.focus-cloud::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.75), transparent 55%),
    radial-gradient(circle at 70% 45%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(circle at 40% 75%, rgba(255, 255, 255, 0.45), transparent 60%);
  filter: blur(6px);
  opacity: 0.85;
  pointer-events: none;
  z-index: -1;
  animation: focus-cloud-pulse 3.2s ease-in-out infinite;
}

.edge-line.cloud-focus {
  stroke: rgba(85, 110, 130, 0.75);
  stroke-width: 2.2px;
  filter: drop-shadow(0 0 6px rgba(210, 230, 245, 0.7));
  animation: focus-edge-pulse 2.8s ease-in-out infinite;
}

@keyframes focus-cloud-pulse {
  0% { opacity: 0.65; transform: scale(0.98); }
  50% { opacity: 0.95; transform: scale(1.03); }
  100% { opacity: 0.65; transform: scale(0.98); }
}

@keyframes focus-edge-pulse {
  0% { stroke-opacity: 0.45; }
  50% { stroke-opacity: 0.9; }
  100% { stroke-opacity: 0.45; }
}

.node.small {
  min-width: 38px;
  padding: 12px;
  border-radius: 0;
}

.node.active {
  outline: 3px solid var(--line);
  transform: translateY(-1px);
}

.node.preview {
  opacity: 0.65;
  border-style: dashed;
}

.node.type-vision { background: var(--vision); border-color: var(--line); }
.node.type-goal { background: var(--goal); border-color: var(--line); }
.node.type-project { background: var(--project); border-color: var(--line); }
.node.type-milestone { background: var(--milestone); border-color: var(--line); }
.node.type-module { background: var(--module); border-color: var(--line); }
.node.type-task { background: var(--task); border-color: var(--line); }
.node.type-idea { background: var(--idea); border-color: var(--line); }

.add-node {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 0;
  border: 3px solid var(--line);
  background: #fff;
  font-size: 16px;
  font-weight: 500;
  color: rgba(18, 18, 18, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.add-node::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 50%;
  width: 24px;
  height: 2px;
  background: var(--stage);
  transform: translateY(-50%);
}

.nodes > .add-node:first-child::before {
  display: none;
}

.level-row[data-level='VISION'] .add-node::before {
  display: none;
}

.level-row[data-level='MILESTONE'] .add-node::before {
  display: none;
}

.levels.project-view .level-row[data-level='MILESTONE'] .add-node {
  background: transparent;
}

.levels.project-view .add-node {
  border-radius: 0;
}

.levels.project-view .add-node:hover {
  background: rgba(18, 18, 18, 0.08);
  color: rgba(18, 18, 18, 0.8);
}
.node.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.node.done {
  opacity: 0.85;
  filter: brightness(1.02) saturate(0.92);
}

.node .node-progress-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -10px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border: 3px solid var(--line);
  background: #fff;
}

.node .node-progress-segment {
  height: 6px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.22);
}

.node .node-progress-segment.done {
  background: var(--accent);
}

.edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto;
}

.edge-line {
  pointer-events: none;
  stroke: rgba(18, 18, 18, 0.6);
  stroke-width: 2.5px;
}

.edge-line.project-view-connection {
  stroke: rgba(88, 195, 170, 0.5);
  stroke-width: 2px;
  stroke-dasharray: 4 2;
}

.edge-hit {
  cursor: pointer;
}

.detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 28, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9;
}

.detail-modal.active {
  display: flex;
}

.detail-panel {
  background: var(--surface);
  border-radius: 0;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(520px, 90vw);
  max-height: 88vh;
  overflow: auto;
  border: 4px solid var(--line);
}

.detail-panel .detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-header h2 {
  margin: 6px 0 0;
  font-family: var(--font-primary);
}

.detail-header input,
.detail-header select {
  width: 100%;
  border-radius: 0;
  border: 3px solid var(--line);
  padding: 10px 12px;
  font-family: var(--font-primary);
  font-size: 16px;
  background: #fff;
}

.detail-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0;
}

.detail-type {
  margin-top: 8px;
  color: var(--muted);
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-family: var(--font-primary);
  font-size: 14px;
}

.detail-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-section textarea,
.detail-section input,
.detail-section select {
  width: 100%;
  border-radius: 0;
  border: 3px solid var(--line);
  padding: 10px 12px;
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

.detail-section textarea {
  resize: vertical;
}

.share-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.share-row select,
.share-row input {
  margin: 0;
}

.share-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.share-members {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 2px solid var(--line);
  padding: 8px 10px;
  background: #fff;
}

.share-member-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-member-email {
  font-size: 13px;
  color: var(--ink);
}

.share-member-role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.share-member button {
  border-radius: 0;
  border: 2px solid var(--line);
  background: transparent;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.share-member button:hover {
  background: rgba(15, 18, 28, 0.08);
}

.share-member button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inline-input {
  display: flex;
  gap: 8px;
}

.inline-input input {
  flex: 1;
}

.preset-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.preset-row input {
  flex: 1;
}

.preset-row textarea {
  flex: 1;
  border: 3px solid var(--line);
  border-radius: 0;
  padding: 6px 8px;
  font-family: var(--font-primary);
  font-size: 12px;
  background: #fff;
}

.preset-row button {
  padding: 6px 10px;
}

.module-presets {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.module-presets select {
  padding: 4px 8px;
  border: 3px solid var(--line);
  border-radius: 0;
  background: #fff;
  font-family: var(--font-primary);
  font-size: 11px;
  color: var(--ink);
}

.module-presets button {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 0;
  border: 3px solid var(--line);
  background: #fff;
}


.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.detail-meta .field {
  min-width: 150px;
  flex: 1;
}

.detail-meta input[readonly] {
  background: rgba(0, 0, 0, 0.05);
}

.comment-block ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}

.comment-block li {
  padding: 10px 12px;
  border-radius: 0;
  border: 3px solid var(--line);
  background: #fff;
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 6px 10px;
  border-radius: 0;
  border: 3px solid var(--line);
  background: #fff;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 60px 1fr;
  }

  .detail-panel {
    grid-column: 1 / -1;
  }

  body.idea-space-open .layout,
  body.idea-space-open:not(.project-view) .layout {
    grid-template-columns: 1fr;
  }

  .idea-space {
    position: static;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .account-progress {
    width: 100%;
  }

  .tree-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .action-progress {
    max-width: none;
  }

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

  .controls {
    flex-direction: row;
    justify-content: center;
  }

  .share-row {
    grid-template-columns: 1fr;
  }

  .share-row button {
    width: 100%;
  }

  .level-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
