:root {
  --bg-0: #0f0f0f;
  --bg-1: #141414;
  --bg-2: #1b1b1b;
  --surface: rgba(27, 27, 27, 0.68);
  --surface-strong: rgba(31, 31, 31, 0.88);
  --surface-2: rgba(25, 25, 25, 0.9);
  --line: rgba(130, 130, 130, 0.28);
  --text: #f1f1ef;
  --muted: #b0b0ab;
  --accent: #f97316;
  --good: #22c55e;
  --danger: #ef4444;
  --gray-accent: #9ca3af;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.45);
  --sidebar-width: 296px;
  --panel-gap: clamp(8px, 0.9vw, 12px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  font-size: clamp(13px, 0.56vw + 8.8px, 15px);
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(
    circle at 14% 8%,
    #242424 0%,
    #151515 45%,
    #0f0f0f 100%
  );
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 1.42;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100dvh;
  max-width: 1700px;
  margin: 0 auto;
  gap: var(--panel-gap);
  backdrop-filter: blur(8px);
}

.mobile-sidebar-btn,
.sidebar-backdrop {
  display: none;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(
    165deg,
    rgba(20, 20, 20, 0.95),
    rgba(15, 15, 15, 0.94)
  );
  border-right: 1px solid var(--line);
  padding: 12px;
  overflow-y: auto;
  transition:
    grid-template-columns 0.24s ease,
    width 0.22s ease,
    padding 0.22s ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.sidebar h2 {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1.12rem;
  margin-bottom: 0;
}

.sidebar-collapsed {
  width: auto;
  padding: 14px 12px;
}

.sidebar-collapsed .add-phase,
.sidebar-collapsed .global-progress h4,
.sidebar-collapsed #globalText,
.sidebar-collapsed #cookieBadge,
.sidebar-collapsed .phase-delete-btn,
.sidebar-collapsed #newPhaseInput,
.sidebar-collapsed #addPhaseBtn {
  display: none;
}

.sidebar-collapsed .sidebar-head {
  justify-content: center;
}

.sidebar-collapsed .sidebar-head h2 {
  display: none;
}

.sidebar-collapsed #sidebarToggleBtn {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
}

.sidebar-collapsed .phase-row {
  grid-template-columns: 1fr;
  margin-bottom: 10px;
}

.sidebar-collapsed .phase-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0;
  border-radius: 12px;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.sidebar-collapsed .global-progress {
  padding: 12px 8px;
  margin-top: 16px;
}

.sidebar-collapsed .global-progress .bar {
  height: 12px;
}

.sidebar-collapsed .global-progress h4 {
  font-size: 0.7rem;
  margin-bottom: 6px;
}

.sidebar-collapsed #globalText {
  font-size: 0.7rem;
  margin-top: 4px;
  display: block;
}

.add-phase {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

input,
textarea,
button,
.file-label,
select {
  font-family: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(130, 130, 130, 0.36);
  background: rgba(17, 17, 17, 0.92);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.24);
}

button,
.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(130, 130, 130, 0.34);
  background: linear-gradient(
    150deg,
    rgba(35, 35, 35, 0.95),
    rgba(22, 22, 22, 0.9)
  );
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover,
.file-label:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.phase-btn {
  width: 100%;
  min-width: 0;
  text-align: left;
  background: rgba(28, 28, 28, 0.92);
  position: relative;
  overflow: hidden;
}

.phase-btn-content {
  display: inline-flex;
  align-items: center;
  padding-left: 10px;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(130, 130, 130, 0.42);
  background: linear-gradient(
    180deg,
    rgba(46, 46, 46, 0.95),
    rgba(28, 28, 28, 0.93)
  );
  color: #d7d7d3;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.phase-label-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.phase-label {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  will-change: transform;
}

.phase-label.is-marquee {
  width: max-content;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  padding-right: 12px;
  animation: phaseLabelMarquee var(--phase-marquee-duration, 9s) linear 0.5s
    infinite;
}

@keyframes phaseLabelMarquee {
  0% {
    transform: translateX(0);
  }
  22% {
    transform: translateX(0);
  }
  78% {
    transform: translateX(calc(var(--phase-marquee-shift, 0px) * -1));
  }
  100% {
    transform: translateX(calc(var(--phase-marquee-shift, 0px) * -1));
  }
}

.phase-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

.phase-delete-btn {
  min-width: 42px;
  padding: 10px 0;
}

.phase-btn.active {
  border-color: var(--good);
  background: linear-gradient(
    125deg,
    rgba(33, 33, 33, 0.98),
    rgba(41, 41, 41, 0.94)
  );
}

.phase-btn.active .phase-chip {
  border-color: rgba(34, 197, 94, 0.6);
  background: linear-gradient(
    180deg,
    rgba(22, 58, 39, 0.95),
    rgba(20, 38, 30, 0.95)
  );
  color: #bdf7d3;
}

.sidebar-collapsed .phase-btn {
  overflow: visible;
}

.global-progress {
  margin-top: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.global-progress h4 {
  margin-bottom: 8px;
}

.global-progress small {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-top: 6px;
}

.bar {
  width: 100%;
  height: 12px;
  background: rgba(130, 130, 130, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

#phaseFill,
#globalFill {
  height: 100%;
  width: 0%;
  background: #f97316;
  transition:
    width 0.35s ease,
    background-color 0.35s ease;
}

#cookieBadge {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.main {
  padding: clamp(10px, 1.1vw, 16px);
  overflow-y: auto;
  min-width: 0;
}

.workspace-note,
.insight-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.workspace-note {
  padding: 14px;
  margin-bottom: 12px;
}

.workspace-note h3 {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 700;
  margin-bottom: 4px;
}

.workspace-note p {
  color: var(--muted);
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.header h1 {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
}

.progress {
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress .bar {
  flex: 1;
}

.progress small {
  min-width: 35px;
  text-align: right;
  font-weight: 600;
  color: var(--accent);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.task-create,
.sync-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.ghost {
  background: rgba(38, 38, 38, 0.86);
  border-color: rgba(130, 130, 130, 0.35);
}

.danger {
  background: linear-gradient(
    140deg,
    rgba(127, 29, 29, 0.45),
    rgba(185, 28, 28, 0.35)
  );
  border-color: rgba(239, 68, 68, 0.65);
}

#importFile {
  display: none;
}

.task-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 0;
  padding: 14px 10px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 12px;
}

.summary-chip {
  background: rgb(4 4 4 / 88%);
  border: 1px solid rgba(130, 130, 130, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  color: #c96118;
  font-size: 0.75rem;
  flex: 1 1 48%;
}

.sidebar-collapsed .task-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  margin-bottom: 0;
  padding: 10px 8px;
}

.sidebar-collapsed .summary-chip {
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.65rem;
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
}

.insight-panel {
  margin-bottom: 10px;
  padding: 10px;
}

.insight-head h2 {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 700;
  margin-bottom: 4px;
}

.insight-head p {
  color: var(--muted);
  margin-bottom: 10px;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: var(--panel-gap);
  align-items: stretch;
}

.insight-grid > :first-child {
  position: relative;
  overflow-y: auto;
  max-height: 660px;
  padding-right: 6px;
  scroll-behavior: smooth;
}

.insight-grid > :first-child::-webkit-scrollbar {
  width: 6px;
}

.insight-grid > :first-child::-webkit-scrollbar-track {
  background: rgba(130, 130, 130, 0.08);
  border-radius: 999px;
}

.insight-grid > :first-child::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.4);
  border-radius: 999px;
}

.insight-grid > :first-child::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.6);
}

#bubbleChart {
  width: 100%;
  min-height: 260px;
  background: linear-gradient(
    170deg,
    rgba(26, 26, 26, 0.94),
    rgba(17, 17, 17, 0.9)
  );
  border: 1px solid rgba(130, 130, 130, 0.3);
  border-radius: 16px;
  display: block;
  margin-bottom: 10px;
}

.phase-stats {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  max-height: calc((5 * 72px) + (4 * 6px));
  padding-right: 4px;
  mask-image: linear-gradient(to bottom, black 0%, black 86%, transparent 100%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 86%,
    transparent 100%
  );
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 115, 22, 0.16) transparent;
}

.phase-stats::-webkit-scrollbar {
  width: 1px;
}

.phase-stats::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.phase-stats::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.14);
  border-radius: 999px;
}

.phase-stats::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.28);
}

.stat-card {
  border: 1px solid rgba(130, 130, 130, 0.3);
  background: rgba(27, 27, 27, 0.88);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.stat-card.tone-green {
  border-color: rgba(34, 197, 94, 0.5);
}

.stat-card.tone-orange {
  border-color: rgba(249, 115, 22, 0.48);
}

.stat-card.tone-red {
  border-color: rgba(239, 68, 68, 0.5);
}

.stat-card.tone-gray {
  border-color: rgba(156, 163, 175, 0.45);
}

.stat-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.stat-card h4 {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.stat-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.stat-confidence {
  color: #f1f1ef;
  font-weight: 700;
}

.stat-progress-track,
.stat-progress-fill {
  display: none;
}

.kanban-title {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 700;
  margin: 8px 0;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--panel-gap);
}

.main,
.sidebar,
.modal-card,
.modal-note,
.card-note-editor {
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 115, 22, 0.78) rgba(48, 48, 48, 0.58);
}

.main::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.modal-note::-webkit-scrollbar,
.card-note-editor::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.main::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track,
.modal-note::-webkit-scrollbar-track,
.card-note-editor::-webkit-scrollbar-track {
  background: rgba(36, 36, 36, 0.72);
  border-radius: 999px;
}

.main::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb,
.modal-note::-webkit-scrollbar-thumb,
.card-note-editor::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(249, 115, 22, 0.86),
    rgba(120, 120, 120, 0.86)
  );
  border-radius: 999px;
  border: 1px solid rgba(24, 24, 24, 0.72);
}

.main::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.modal-card::-webkit-scrollbar-thumb:hover,
.modal-note::-webkit-scrollbar-thumb:hover,
.card-note-editor::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(249, 115, 22, 0.9),
    rgba(124, 124, 124, 0.9)
  );
}

.col {
  min-height: 230px;
  background: linear-gradient(
    180deg,
    rgba(29, 29, 29, 0.92),
    rgba(18, 18, 18, 0.88)
  );
  border: 1px solid rgba(130, 130, 130, 0.3);
  border-radius: 14px;
  padding: 10px;
  transition: 0.18s ease;
  box-shadow: var(--shadow);
}

.col h3 {
  margin-bottom: 10px;
  color: var(--muted);
}

.drop-target {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.24);
}

.card {
  background: rgba(36, 36, 36, 0.92);
  border: 1px solid rgba(130, 130, 130, 0.28);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 6px;
  cursor: grab;
  animation: cardIn 0.22s ease;
}

.card.dragging {
  opacity: 0.65;
  cursor: grabbing;
  transform: rotate(1deg) scale(1.01);
}

.card-title {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-weight: 700;
}

.card-title:focus {
  box-shadow: none;
  border: none;
}

.card-note {
  margin-top: 8px;
  min-height: 74px;
  resize: vertical;
  font-size: 0.93rem;
}

.card-note-editor {
  margin-top: 8px;
  min-height: 84px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(130, 130, 130, 0.3);
  background: rgba(19, 19, 19, 0.9);
  border-radius: 10px;
  padding: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
  font-size: 0.94rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 140, 140, 0.55) transparent;
}

.card-note-editor::-webkit-scrollbar,
.modal-note::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.card-note-editor::-webkit-scrollbar-track,
.modal-note::-webkit-scrollbar-track {
  background: transparent;
}

.card-note-editor::-webkit-scrollbar-thumb,
.modal-note::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(130, 130, 130, 0.7),
    rgba(80, 80, 80, 0.72)
  );
  border-radius: 999px;
}

.card-note-editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.22);
}

.card-note-editor p,
.card-note-editor ul,
.card-note-editor ol,
.card-note-editor pre,
.card-note-editor blockquote {
  margin: 0 0 12px;
}

.card-note-editor h1,
.card-note-editor h2,
.card-note-editor h3,
.card-note-editor h4 {
  margin: 10px 0 8px;
  line-height: 1.3;
}

.card-note-editor pre {
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(130, 130, 130, 0.25);
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
}

.card-note-editor blockquote {
  border-left: 3px solid rgba(249, 115, 22, 0.65);
  padding-left: 10px;
  color: #d6d6d3;
}

.card-note-editor p:last-child,
.card-note-editor ul:last-child,
.card-note-editor ol:last-child,
.card-note-editor pre:last-child,
.card-note-editor blockquote:last-child {
  margin-bottom: 0;
}

.card-footer {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.card-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.status-select {
  flex: 1;
  border: 1px solid rgba(130, 130, 130, 0.3);
  background: rgba(19, 19, 19, 0.9);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}

.task-delete-btn {
  min-width: 72px;
}
.zoom-btn {
  min-width: 100px;
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: min(760px, 96vw);
  max-height: 88vh;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(130, 130, 130, 0.38);
  background: linear-gradient(
    160deg,
    rgba(29, 29, 29, 0.96),
    rgba(17, 17, 17, 0.95)
  );
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.48);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(130, 130, 130, 0.26);
  background: rgba(24, 24, 24, 0.96);
}

.modal-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.modal-note {
  min-height: 280px;
  max-height: 62vh;
  background: linear-gradient(
    180deg,
    rgba(30, 30, 30, 0.98),
    rgba(20, 20, 20, 0.96)
  );
  border: 1px solid rgba(130, 130, 130, 0.35);
  border-radius: 10px;
  padding: 26px 28px;
  line-height: 1.85;
  font-size: 1.04rem;
  letter-spacing: 0.005em;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 140, 140, 0.55) transparent;
}

.modal-note p,
.modal-note ul,
.modal-note ol,
.modal-note pre,
.modal-note blockquote {
  margin-bottom: 14px;
}

.modal-body label {
  color: #d8d8d5;
  font-size: 0.9rem;
}

#modalTitleInput,
#modalStatusSelect {
  max-width: 420px;
}

#modalTimeMeta {
  color: var(--muted);
}

#saveIndicator {
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
}

@keyframes cardIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 1081px) {
  .sidebar-collapsed .phase-btn[data-tip]:hover::after,
  .sidebar-collapsed .phase-btn[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    white-space: nowrap;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(130, 130, 130, 0.34);
    background: rgba(22, 22, 22, 0.96);
    color: #ecece9;
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.4);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    animation: phaseTipIn 0.16s ease;
  }

  .sidebar-collapsed .phase-btn[data-tip]:hover::before,
  .sidebar-collapsed .phase-btn[data-tip]:focus-visible::before {
    content: "";
    position: absolute;
    left: calc(100% + 5px);
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    border-left: 1px solid rgba(130, 130, 130, 0.34);
    border-top: 1px solid rgba(130, 130, 130, 0.34);
    background: rgba(22, 22, 22, 0.96);
    z-index: 19;
  }
}

@keyframes phaseTipIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@media (min-width: 1081px) and (max-height: 900px) {
  .sidebar {
    padding: 10px;
  }

  .phase-row {
    margin-bottom: 6px;
  }

  .header {
    margin-bottom: 8px;
  }

  .toolbar,
  .task-summary,
  .insight-panel {
    margin-bottom: 8px;
  }

  .kanban-title {
    margin: 6px 0;
  }

  #bubbleChart {
    min-height: 220px;
    max-height: 52vh;
  }

  .col {
    min-height: 210px;
  }
}

@media (max-width: 1080px) {
  .app {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    height: auto;
    max-width: none;
    margin: 0;
    gap: 0;
  }

  .mobile-sidebar-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 18;
    display: inline-flex;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(150, 150, 150, 0.42);
    background: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(8px);
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 14;
    background: rgba(0, 0, 0, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 16;
    width: min(88vw, 380px);
    height: 100dvh;
    border-right: 1px solid var(--line);
    border-bottom: none;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    max-height: none;
  }

  .app.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .app.sidebar-mobile-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    overflow-y: visible;
    padding-top: 68px;
  }

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

  .progress {
    min-width: 100%;
  }

  .toolbar {
    align-items: stretch;
  }

  .task-create,
  .sync-actions {
    width: 100%;
  }

  .task-create input,
  .task-create button,
  .sync-actions .ghost,
  .sync-actions .danger,
  .sync-actions .file-label {
    flex: 1 1 170px;
  }

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

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

  #bubbleChart {
    min-height: 250px;
  }
}

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

  .task-create,
  .sync-actions,
  .add-phase {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: min(92vw, 360px);
    padding: 14px;
  }

  .mobile-sidebar-btn {
    top: 10px;
    left: 10px;
    right: 10px;
    justify-content: center;
  }

  .main {
    padding-top: 74px;
  }

  #bubbleChart {
    min-height: 220px;
    border-radius: 14px;
  }

  .add-phase input,
  .add-phase button,
  .task-create input,
  .task-create button,
  .sync-actions .ghost,
  .sync-actions .danger,
  .sync-actions .file-label {
    width: 100%;
    flex: 1 1 100%;
  }

  button,
  .file-label {
    min-height: 42px;
  }
}

.site-logo {
  display: block; /* Makes the whole area clickable */
  max-width: 180px; /* Limits the size of the logo */
  height: auto; /* Maintains aspect ratio */
  transition: opacity 0.3s ease; /* Adds a smooth hover effect */
}

.site-logo:hover {
  opacity: 0.8; /* Subtle visual feedback on hover */
}

.site-logo img {
  width: 100%; /* Ensures the image fills the container */
  display: block;
}
