:root {
  color-scheme: light;
  --paper: #f6f3ee;
  --ink: #1d1d1f;
  --muted: #665f56;
  --line: #d8d1c6;
  --panel: #ffffff;
  --board: #fffaf3;
  --accent: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 100vh;
  padding: 28px 20px;
}

.topbar {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding-bottom: 24px;
}

.header-actions {
  align-items: end;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: min(360px, 100%);
}

.tab-list {
  align-self: end;
  background: #e8e1d8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  width: 276px;
}

.tab-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding: 9px 12px;
}

.tab-button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.12);
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(36px, 6vw, 62px);
  line-height: 0.98;
  margin: 0;
  max-width: 660px;
}

h2 {
  font-size: 18px;
  margin: 0;
}

.progress-card {
  width: 100%;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.progress-label {
  display: flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-track {
  background: #ddd6ca;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.progress-bar {
  background: var(--accent);
  border-radius: inherit;
  height: 100%;
  transition: width 180ms ease;
  width: 0%;
}

.workspace {
  display: grid;
  gap: 24px;
  grid-template-columns: 230px 1fr 280px;
}

.path-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.path-card,
.panel,
.skill-node {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.path-card {
  background: transparent;
  min-height: 112px;
  position: relative;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.path-card:hover,
.path-card.active {
  background: var(--panel);
}

.path-card.active {
  border-color: var(--ink);
  box-shadow: 0 8px 0 rgba(29, 29, 31, 0.08);
}

.path-button {
  background: transparent;
  border: 0;
  color: inherit;
  display: block;
  min-height: 110px;
  padding: 16px 44px 16px 16px;
  text-align: left;
  width: 100%;
}

.path-name {
  display: block;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 7px;
}

.path-tagline {
  color: var(--muted);
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.skill-board {
  background:
    linear-gradient(90deg, transparent 49%, rgba(29, 29, 31, 0.1) 49% 51%, transparent 51%),
    linear-gradient(#e8e1d8 1px, transparent 1px),
    linear-gradient(90deg, #e8e1d8 1px, transparent 1px);
  background-color: var(--board);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 560px;
  padding: 22px;
}

.skill-node {
  align-self: center;
  background: var(--panel);
  box-shadow: 0 8px 0 rgba(29, 29, 31, 0.08);
  color: var(--ink);
  min-height: 136px;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.skill-toggle {
  background: transparent;
  border: 0;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-height: 136px;
  padding: 16px 44px 16px 16px;
  text-align: left;
  width: 100%;
}

.empty-state {
  align-self: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed #bfb5a6;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 340px;
  padding: 24px;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 20px;
}

.empty-state span {
  font-size: 14px;
  line-height: 1.4;
}

.skill-node:hover:has(.skill-toggle:not(:disabled)) {
  box-shadow: 0 10px 0 rgba(29, 29, 31, 0.12);
  transform: translateY(-2px);
}

.skill-node.complete {
  border-color: var(--accent);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--accent) 24%, transparent);
}

.skill-node.started {
  border-color: #ca8a04;
  box-shadow: 0 8px 0 rgba(202, 138, 4, 0.16);
}

.skill-node.locked {
}

.skill-node.locked .skill-toggle {
  cursor: not-allowed;
  opacity: 0.48;
}

.delete-button {
  align-items: center;
  background: #dc2626;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(127, 29, 29, 0.28);
  color: #ffffff;
  display: flex;
  height: 30px;
  justify-content: center;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 10px;
  transform: scale(0.86);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
  width: 30px;
  z-index: 2;
}

.delete-button:hover {
  background: #b91c1c;
}

.delete-button svg {
  fill: currentColor;
  height: 17px;
  width: 17px;
}

.edit-button {
  align-items: center;
  background: #2563eb;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(30, 64, 175, 0.24);
  color: #ffffff;
  display: flex;
  height: 30px;
  justify-content: center;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  right: 46px;
  top: 10px;
  transform: scale(0.86);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
  width: 30px;
  z-index: 2;
}

.edit-button:hover {
  background: #1d4ed8;
}

.edit-button svg {
  fill: currentColor;
  height: 16px;
  width: 16px;
}

.path-card:hover .delete-button,
.path-card:focus-within .delete-button,
.skill-node:hover .delete-button,
.skill-node:focus-within .delete-button,
.goal-item:hover .delete-button,
.goal-item:focus-within .delete-button,
.path-card:hover .edit-button,
.path-card:focus-within .edit-button,
.skill-node:hover .edit-button,
.skill-node:focus-within .edit-button,
.goal-item:hover .edit-button,
.goal-item:focus-within .edit-button {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.node-status {
  align-self: flex-start;
  background: color-mix(in srgb, var(--accent) 12%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, white);
  border-radius: 999px;
  color: #343437;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
}

.complete .node-status {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.started .node-status {
  background: #ca8a04;
  border-color: #ca8a04;
  color: #ffffff;
}

.node-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.node-detail {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.level-1 {
  grid-column: 1;
}

.level-2 {
  grid-column: 2;
}

.level-3 {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 360px);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: var(--panel);
  padding: 20px;
}

.panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 10px 0 0;
}

.counter {
  color: var(--ink) !important;
  font-size: 34px !important;
  font-weight: 800;
  line-height: 1 !important;
}

.counter small {
  color: var(--muted);
  font-size: 16px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

input {
  border: 1px solid #c9c0b3;
  border-radius: 8px;
  margin-top: 12px;
  outline: none;
  padding: 11px 12px;
  width: 100%;
}

select {
  background: #ffffff;
  border: 1px solid #c9c0b3;
  border-radius: 8px;
  margin-top: 12px;
  outline: none;
  padding: 11px 12px;
  width: 100%;
}

textarea {
  border: 1px solid #c9c0b3;
  border-radius: 8px;
  min-height: 92px;
  outline: none;
  padding: 11px 12px;
  resize: vertical;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
}

.field-label {
  margin-top: 14px;
}

form button {
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 800;
  margin-top: 12px;
  padding: 11px 14px;
  width: 100%;
}

form button:hover {
  background: #343437;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  margin-top: 16px;
  padding: 11px 14px;
  width: 100%;
}

.secondary-button:hover {
  background: #f6f3ee;
}

.import-label {
  margin-top: 18px;
}

.save-panel input[type="file"] {
  font-size: 13px;
}

.goals-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(320px, 1.2fr);
}

.goals-copy {
  align-self: start;
  border-top: 4px solid var(--accent);
  padding-top: 18px;
}

.goals-copy h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.goals-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 14px 0 0;
}

.goal-form {
  align-self: start;
}

.goals-panel {
  min-height: 420px;
}

.goal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.goal-item {
  align-items: start;
  background: #fffaf3;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 72px 1fr;
  padding: 14px;
  position: relative;
}

.goal-item.complete {
  border-color: var(--accent);
}

.goal-check {
  background: color-mix(in srgb, var(--accent) 12%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, white);
  border-radius: 999px;
  color: #343437;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 8px 10px;
}

.goal-item.complete .goal-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.goal-item h3 {
  font-size: 17px;
  line-height: 1.2;
  margin: 0;
  padding-right: 42px;
}

.goal-item p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 6px 0 0;
}

.goal-empty {
  margin: 40px auto 0;
}

.goal-subject {
  background: color-mix(in srgb, var(--accent) 12%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, white);
  border-radius: 999px;
  color: #343437;
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  padding: 6px 8px;
}

.goal-progress {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.goal-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.edit-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(29, 29, 31, 0.24);
  max-width: min(520px, calc(100vw - 28px));
  padding: 0;
  width: 100%;
}

.edit-dialog::backdrop {
  background: rgba(29, 29, 31, 0.34);
}

.edit-form {
  background: var(--panel);
  padding: 22px;
}

.edit-form h2 {
  margin-bottom: 18px;
}

.dialog-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.dialog-actions .secondary-button {
  background: #ffffff;
  border: 1px solid var(--ink);
  color: var(--ink);
}

.tree-scene {
  background: linear-gradient(#66b9f2 0%, #87cdf8 52%, #6fcb59 52%, #34a853 100%);
  border: 1px solid #73aad4;
  border-radius: 8px;
  box-shadow: inset 0 -24px 0 rgba(26, 120, 48, 0.14);
  min-height: 660px;
  overflow: hidden;
  position: relative;
}

.cloud {
  background: #ffffff;
  border-radius: 999px;
  box-shadow:
    28px 8px 0 8px #ffffff,
    64px 0 0 12px #ffffff,
    98px 10px 0 4px #ffffff;
  position: absolute;
}

.cloud-left {
  height: 52px;
  left: 44px;
  top: 72px;
  width: 112px;
}

.cloud-right {
  height: 46px;
  right: 128px;
  top: 96px;
  width: 104px;
}

.status-cloud {
  box-shadow:
    34px 12px 0 10px #ffffff,
    82px 0 0 22px #ffffff,
    142px 14px 0 12px #ffffff,
    0 12px 28px rgba(28, 82, 124, 0.14);
  color: var(--ink);
  height: auto;
  left: 50%;
  padding: 28px 34px 20px;
  top: 38px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 64px));
  z-index: 4;
}

.status-cloud .progress-label {
  gap: 18px;
  position: relative;
  z-index: 1;
}

.sky-progress {
  background: #d7eefc;
  height: 11px;
  position: relative;
  z-index: 1;
}

.status-cloud p {
  color: #315167;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  margin: 10px 0 0;
  position: relative;
  z-index: 1;
}

.tree-visual {
  --stage: 1;
  --apple-opacity: 0;
  --branch-opacity: 0;
  --crown-opacity: 0;
  --flower-opacity: 0;
  --leaf-opacity: 0.1;
  --top-leaf-opacity: 0;
  bottom: 138px;
  height: 390px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 420px;
  z-index: 2;
}

.trunk {
  background:
    linear-gradient(90deg, rgba(64, 36, 16, 0.28), transparent 22% 72%, rgba(48, 29, 13, 0.24)),
    linear-gradient(#9b5b2d, #6f3e1f);
  border-radius: 42% 46% 14px 14px;
  bottom: 0;
  box-shadow: inset -10px 0 0 rgba(62, 36, 18, 0.25);
  height: calc(46px + (var(--stage) * 22px));
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  transition: height 260ms ease, width 260ms ease;
  width: calc(20px + (var(--stage) * 5px));
  z-index: 2;
}

.branch {
  background: #7a4724;
  border-radius: 999px;
  bottom: calc(54px + (var(--stage) * 19px));
  height: calc(4px + (var(--stage) * 1.1px));
  opacity: var(--branch-opacity);
  position: absolute;
  transition: all 260ms ease;
  width: calc(34px + (var(--stage) * 10px));
  z-index: 1;
}

.branch-left {
  left: calc(50% - 16px - (var(--stage) * 9px));
  transform: rotate(-29deg);
  transform-origin: right center;
}

.branch-right {
  right: calc(50% - 16px - (var(--stage) * 9px));
  transform: rotate(31deg);
  transform-origin: left center;
}

.leaf {
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.2), transparent 26%),
    radial-gradient(circle at 68% 70%, rgba(20, 95, 33, 0.22), transparent 32%),
    #2f9e44;
  border-radius: 52% 48% 46% 54%;
  box-shadow:
    inset -18px -18px 0 rgba(19, 122, 43, 0.22),
    inset 14px 12px 0 rgba(92, 184, 91, 0.22);
  height: calc(26px + (var(--stage) * 23px));
  opacity: var(--leaf-opacity);
  position: absolute;
  transition: all 280ms ease;
  width: calc(30px + (var(--stage) * 28px));
  z-index: 3;
}

.leaf-back {
  bottom: calc(74px + (var(--stage) * 17px));
  left: 50%;
  transform: translateX(-50%) scale(0.9);
}

.leaf-left {
  bottom: calc(68px + (var(--stage) * 16px));
  left: calc(50% - 8px - (var(--stage) * 18px));
  transform: translateX(-50%) rotate(-10deg);
}

.leaf-right {
  bottom: calc(66px + (var(--stage) * 15px));
  right: calc(50% - 8px - (var(--stage) * 18px));
  transform: translateX(50%) rotate(12deg);
}

.leaf-top {
  bottom: calc(92px + (var(--stage) * 22px));
  left: 50%;
  opacity: var(--top-leaf-opacity);
  transform: translateX(-50%) scale(0.78);
}

.apple {
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.72), transparent 18%),
    #dc2626;
  border-radius: 52% 48% 56% 44%;
  box-shadow: inset -4px -5px 0 rgba(127, 29, 29, 0.28);
  height: 22px;
  opacity: var(--apple-opacity);
  position: absolute;
  transition: opacity 220ms ease;
  width: 22px;
  z-index: 5;
}

.apple-one {
  bottom: calc(120px + (var(--stage) * 18px));
  left: calc(50% - 18px - (var(--stage) * 12px));
}

.apple-two {
  bottom: calc(112px + (var(--stage) * 17px));
  right: calc(50% - 20px - (var(--stage) * 13px));
}

.flower {
  height: 34px;
  opacity: var(--flower-opacity);
  position: absolute;
  transition: opacity 220ms ease;
  width: 34px;
  z-index: 5;
}

.flower::before,
.flower::after {
  background: #f9a8d4;
  border-radius: 999px;
  content: "";
  height: 26px;
  left: 4px;
  position: absolute;
  top: 4px;
  width: 26px;
}

.flower::before {
  transform: rotate(45deg);
}

.flower::after {
  transform: rotate(-45deg);
}

.flower-one {
  bottom: 6px;
  left: calc(50% - 92px);
}

.flower-two {
  bottom: 9px;
  right: calc(50% - 98px);
}

.crown {
  border-bottom: 30px solid #facc15;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  bottom: calc(160px + (var(--stage) * 23px));
  filter: drop-shadow(0 5px 0 rgba(113, 63, 18, 0.16));
  height: 0;
  left: 50%;
  opacity: var(--crown-opacity);
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 220ms ease;
  width: 72px;
  z-index: 6;
}

.crown::before {
  background:
    radial-gradient(circle at 14px 8px, #fef3c7 0 5px, transparent 6px),
    radial-gradient(circle at 36px 2px, #fef3c7 0 5px, transparent 6px),
    radial-gradient(circle at 58px 8px, #fef3c7 0 5px, transparent 6px);
  content: "";
  height: 20px;
  left: -18px;
  position: absolute;
  top: 10px;
  width: 72px;
}

.stage-1 .branch,
.stage-1 .leaf-left,
.stage-1 .leaf-right,
.stage-1 .leaf-top,
.stage-2 .leaf-top,
.stage-3 .leaf-top {
  opacity: 0;
}

.grass {
  background:
    linear-gradient(transparent 0 40%, rgba(26, 110, 40, 0.18) 40%),
    linear-gradient(90deg, #2f9e44, #62bf43, #2f9e44);
  bottom: 0;
  height: 150px;
  left: 0;
  position: absolute;
  right: 0;
  z-index: 3;
}

.grass span {
  background: #2f8f37;
  border-radius: 100% 0;
  bottom: 88px;
  display: block;
  height: 54px;
  position: absolute;
  transform: rotate(-18deg);
  width: 10px;
}

.grass span:nth-child(1) {
  left: 9%;
}

.grass span:nth-child(2) {
  bottom: 68px;
  left: 26%;
  transform: rotate(18deg);
}

.grass span:nth-child(3) {
  left: 48%;
}

.grass span:nth-child(4) {
  bottom: 76px;
  left: 71%;
  transform: rotate(22deg);
}

.grass span:nth-child(5) {
  left: 88%;
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .header-actions,
  .tab-list {
    align-self: stretch;
  }

  .path-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .path-card {
    min-width: 190px;
  }

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

  .tree-scene {
    min-height: 620px;
  }

  .tree-visual {
    width: 340px;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 22px 14px;
  }

  .skill-board {
    background:
      linear-gradient(#e8e1d8 1px, transparent 1px),
      linear-gradient(90deg, #e8e1d8 1px, transparent 1px);
    background-color: var(--board);
    background-size: 24px 24px;
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 14px;
  }

  .level-1,
  .level-2,
  .level-3 {
    grid-column: 1;
    width: 100%;
  }

  .skill-node {
    min-height: 124px;
  }

  .path-card .delete-button,
  .path-card .edit-button,
  .skill-node .delete-button,
  .skill-node .edit-button,
  .goal-item .delete-button,
  .goal-item .edit-button {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .path-button,
  .skill-toggle {
    padding-right: 82px;
  }

  .goal-item {
    grid-template-columns: 1fr;
    padding-right: 82px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .tab-list {
    width: 100%;
  }

  .cloud-left,
  .cloud-right {
    display: none;
  }

  .status-cloud {
    top: 28px;
    width: calc(100% - 44px);
  }

  .tree-visual {
    bottom: 128px;
    width: 280px;
  }
}
