:root {
  --mandal-grid-size: 9;
  --mandal-border-color: #dfe5ec;
  --mandal-border-bold-color: #2c3e50;
  --mandal-highlight-color: #fff3cd;
  --mandal-completed-blur: blur(1px);
  --mandal-sidebar-bg: #ffffff;
  --mandal-active-color: rgba(44, 62, 80, 0.1);
  --mandal-danger-color: #ffebee;
  --mandal-board-size: min(88vmin, 980px);
  --mandal-board-padding: 18px;
  --mandal-board-gap: 8px;
  --mandal-grid-track-size: calc((var(--mandal-board-size) - (var(--mandal-board-padding) * 2) - (var(--mandal-board-gap) * 8)) / 9);
  --mandal-cell-size: var(--mandal-grid-track-size);
  --mandal-theme-color: #2c3e50;
  --mandal-page-bg: linear-gradient(180deg, #fbfcfe 0%, #f2f5f9 100%);
  --mandal-card-bg: rgba(255, 255, 255, 0.88);
  --mandal-card-border: rgba(44, 62, 80, 0.08);
  --mandal-card-shadow: 0 16px 40px rgba(36, 52, 71, 0.08);
  --mandal-cell-shadow: 0 2px 10px rgba(36, 52, 71, 0.06);
}

.mandal-art-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--mandal-page-bg);
}

.mandal-art-content-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
  justify-content: center;
}

.mandal-art-toolbar {
  width: min(100%, var(--mandal-board-size));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 4px 14px;
  border-bottom: none;
  background: transparent;
}

.mandal-art-toolbar button {
  padding: 8px 14px;
  border: 1px solid rgba(44, 62, 80, 0.12);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  color: #51606f;
  box-shadow: 0 4px 10px rgba(36, 52, 71, 0.04);
  transition: all 0.18s ease;
}

.mandal-art-toolbar button:hover {
  background: #ffffff;
  border-color: rgba(44, 62, 80, 0.2);
  color: #1f2c39;
}

.mandal-art-toolbar button.is-active {
  background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
  border-color: rgba(44, 62, 80, 0.38);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(44, 62, 80, 0.22);
}

.mandal-art-toolbar button.is-active:hover {
  background: linear-gradient(135deg, #34495e 0%, #2C3E50 100%);
  border-color: rgba(44, 62, 80, 0.46);
  color: #ffffff;
}

.mandal-toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  border-radius: 999px;
  background: rgba(44, 62, 80, 0.16);
  flex: 0 0 auto;
}

.mandal-art-breadcrumb {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 20px;
  margin: 0 auto 0 0;
  padding: 0;
  color: #94a3b8;
  overflow: hidden;
  transform: translateY(7px);
}

.mandal-art-breadcrumb.is-hidden {
  display: none;
}

.mandal-art-toolbar .mandal-art-breadcrumb__item {
  min-width: 0;
  max-width: 150px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
  box-shadow: none;
  transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

.mandal-art-toolbar .mandal-art-breadcrumb__item:hover,
.mandal-art-toolbar .mandal-art-breadcrumb__item:focus-visible {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #475569;
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.mandal-art-toolbar .mandal-art-breadcrumb__item:disabled {
  cursor: default;
  color: #64748b;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  text-decoration: none;
}

.mandal-art-breadcrumb__separator {
  flex: 0 0 auto;
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1;
  transform: translateY(1px);
}

.mandal-art-sidebar {
  width: 280px;
  background-color: rgba(255, 255, 255, 0.92);
  border-right: 1px solid rgba(44, 62, 80, 0.08);
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  overflow-y: auto;
}

.mandal-art-sidebar-header {
  border-bottom: 1px solid rgba(44, 62, 80, 0.08);
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.mandal-art-sidebar h2 {
  font-size: 1.5em;
  color: #2c3e50;
  margin: 0;
  font-weight: 700;
}

.mandal-art-sidebar #mandal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 0;
  overflow: visible;
}

.mandal-art-sidebar #mandal-list li {
  padding: 15px;
  cursor: pointer;
  border-radius: 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease-in-out;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
}

.mandal-art-sidebar #mandal-list li:hover {
  background-color: rgba(44, 62, 80, 0.05);
  border-color: rgba(44, 62, 80, 0.08);
}

.mandal-art-sidebar #mandal-list li.active {
  background-color: var(--mandal-active-color);
  font-weight: 700;
  color: #1f2c39;
}

.mandal-art-sidebar #mandal-list li.mandal-dragging {
  opacity: 0.5;
}

.mandal-art-add-btn-container {
  padding: 12px 0 0;
  margin-top: 4px;
}

.mandal-art-main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 24px 28px 28px;
  overflow: auto;
}

.mandal-art-grid-container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--mandal-grid-size), 1fr);
  grid-template-rows: repeat(var(--mandal-grid-size), 1fr);
  width: min(100%, var(--mandal-board-size));
  height: var(--mandal-board-size);
  gap: var(--mandal-board-gap);
  padding: var(--mandal-board-padding);
  background: var(--mandal-card-bg);
  border: 1px solid var(--mandal-card-border);
  border-radius: 26px;
  box-shadow: var(--mandal-card-shadow);
  backdrop-filter: blur(12px);
  user-select: none;
  -webkit-user-select: none;
}

.mandal-page-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(44, 62, 80, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #25384c;
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(36, 52, 71, 0.12);
  transition: box-shadow 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
}

.mandal-page-arrow--previous {
  left: -18px;
  transform: translate(-100%, -50%);
}

.mandal-page-arrow--next {
  right: -18px;
  transform: translate(100%, -50%);
}

.mandal-page-arrow:hover:not(:disabled),
.mandal-page-arrow:focus-visible:not(:disabled) {
  box-shadow: 0 14px 28px rgba(36, 52, 71, 0.16);
  outline: none;
}

.mandal-page-arrow--add {
  font-size: 1.45rem;
}

.mandal-page-arrow__glyph {
  display: block;
  line-height: 1;
  transform: translateY(1px);
}

.mandal-page-arrow:disabled {
  cursor: default;
  opacity: 0.36;
}

.mandal-art-grid-container .cell {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  min-width: 0;
  min-height: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  background-color: #ffffff;
  border: 1px solid var(--mandal-border-color);
  border-radius: 16px;
  box-shadow: var(--mandal-cell-shadow);
  overflow: hidden;
}

.mandal-art-grid-container .cell.has-risk,
.mandal-matrix th.has-risk,
.mandal-matrix td.has-risk {
  isolation: isolate;
}

.mandal-art-grid-container .cell.has-risk::before,
.mandal-matrix th.has-risk::before,
.mandal-matrix td.has-risk::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--mandal-risk-accent, #ef4444);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.82);
  pointer-events: none;
  z-index: 4;
}

.mandal-art-grid-container .cell.has-risk.has-risk-overlay::before,
.mandal-matrix th.has-risk.has-risk-overlay::before,
.mandal-matrix td.has-risk.has-risk-overlay::before {
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.82),
    0 4px 12px rgba(15, 23, 42, 0.18);
}

.mandal-risk-tooltip__title {
  font-weight: 700;
  color: #ffffff;
}

.mandal-risk-tooltip__divider {
  height: 1px;
  margin: 8px 0;
  background: rgba(226, 232, 240, 0.28);
}

.mandal-risk-tooltip__risk {
  color: #e2e8f0;
}

.mandal-art-grid-container .cell.is-navigable,
.mandal-matrix .is-navigable {
  cursor: pointer;
}

.mandal-art-grid-container .cell.is-addable {
  cursor: default;
}

.mandal-art-grid-container .cell textarea,
.mandal-art-grid-container .cell .mandal-cell-text,
.mandal-matrix-label,
.mandal-matrix td textarea,
.mandal-matrix td .mandal-cell-text {
  cursor: inherit;
}

.mandal-art-grid-container .cell textarea,
.mandal-art-grid-container .cell .mandal-cell-text,
.mandal-matrix-label,
.mandal-matrix td textarea,
.mandal-matrix td .mandal-cell-text {
  position: relative;
  z-index: 2;
}

.mandal-art-grid-container .cell.border-right-bold,
.mandal-art-grid-container .cell.border-bottom-bold {
  margin: 0;
}

.mandal-art-grid-container .cell.central-goal {
  font-weight: 700;
  background: #2f302d;
  border-color: #2f302d;
  box-shadow: 0 12px 24px rgba(47, 48, 45, 0.18);
}

.mandal-art-grid-container .cell.central-goal.is-year-goal-empty.fd-tutorial-focus-cell {
  background: #ffffff !important;
  border-color: #dbe4ef;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

.mandal-art-grid-container .cell.central-goal textarea,
.mandal-art-grid-container .cell.central-goal .mandal-cell-text {
  color: #ffffff;
  font-weight: 700;
}

.mandal-art-grid-container .cell.central-goal.is-year-goal-empty.fd-tutorial-focus-cell textarea,
.mandal-art-grid-container .cell.central-goal.is-year-goal-empty.fd-tutorial-focus-cell .mandal-cell-text {
  color: transparent !important;
}

.mandal-art-grid-container .cell.sub-goal {
  font-weight: 700;
}

.mandal-art-grid-container .cell.sub-goal textarea,
.mandal-art-grid-container .cell.sub-goal .mandal-cell-text {
  color: rgba(255, 255, 255, 0.96);
  font-weight: 700;
}

.mandal-art-grid-container .cell textarea,
.mandal-art-grid-container .cell .mandal-cell-text {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  background-color: transparent;
  padding: 12px 10px;
  font-size: 0.92rem;
  line-height: 1.22;
  text-align: left;
  font-family: "Pretendard", "Segoe UI", "Noto Sans KR", sans-serif;
  color: #5d6570;
  display: block;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0;
  font-weight: 700;
  scrollbar-width: none;
  -ms-overflow-style: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.mandal-matrix-label,
.mandal-matrix td textarea,
.mandal-matrix td .mandal-cell-text {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  padding: 12px 10px;
  font-size: 0.92rem;
  line-height: 1.22;
  text-align: left;
  font-family: "Pretendard", "Segoe UI", "Noto Sans KR", sans-serif;
  color: #5d6570;
  display: block;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0;
  font-weight: 700;
  scrollbar-width: none;
  -ms-overflow-style: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.mandal-art-grid-container .cell textarea::-webkit-scrollbar,
.mandal-art-grid-container .cell .mandal-cell-text::-webkit-scrollbar {
  display: none;
}

.mandal-art-grid-container .cell.sub-goal textarea,
.mandal-art-grid-container .cell.sub-goal .mandal-cell-text,
.mandal-art-grid-container .cell.central-goal textarea,
.mandal-art-grid-container .cell.central-goal .mandal-cell-text {
  font-weight: 700;
}

.mandal-art-grid-container .checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.05em;
  color: #ffffff;
  display: none;
  user-select: none;
  pointer-events: none;
  z-index: 5;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #178754;
  box-shadow: 0 2px 6px rgba(23, 135, 84, 0.28);
  align-items: center;
  justify-content: center;
}

.mandal-art-grid-container .cell.completed .checkmark {
  display: flex;
}

.mandal-add-cell-button {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%) scale(0.88);
  border: 1px solid rgba(44, 62, 80, 0.14);
  border-radius: 50%;
  background: #25384c;
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 22px rgba(36, 52, 71, 0.18);
  transition: opacity 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
  z-index: 2;
}

.mandal-art-grid-container .cell.is-addable:hover .mandal-add-cell-button,
.mandal-art-grid-container .cell.is-year-goal-empty:hover .mandal-add-cell-button,
.mandal-matrix .is-addable:hover .mandal-add-cell-button,
.mandal-matrix .is-addable:focus-within .mandal-add-cell-button,
.mandal-add-cell-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.mandal-add-cell-button:hover,
.mandal-add-cell-button:focus-visible {
  background: #1c2f42;
  outline: none;
}

.mandal-art-grid-container .cell.is-year-goal-empty textarea {
  cursor: pointer;
}

.mandal-task-quick-add-button {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%) scale(0.88);
  border: 1px solid rgba(44, 62, 80, 0.14);
  border-radius: 50%;
  background: #2c3e50;
  color: #ffffff;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 22px rgba(44, 62, 80, 0.2);
  transition: opacity 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
  z-index: 2;
}

.mandal-art-grid-container .cell.is-quick-add-task:hover .mandal-task-quick-add-button,
.mandal-art-grid-container .cell.is-quick-add-task .mandal-cell-text:hover + .checkmark + .mandal-task-quick-add-button,
.mandal-art-grid-container .cell.is-quick-add-task .mandal-cell-text:hover + .mandal-task-quick-add-button,
.mandal-matrix .is-quick-add-task:hover .mandal-task-quick-add-button,
.mandal-matrix .is-quick-add-task .mandal-cell-text:hover + .mandal-task-quick-add-button,
.mandal-matrix .is-quick-add-task .mandal-cell-text:hover + .checkmark + .mandal-task-quick-add-button,
.mandal-art-grid-container .cell.is-quick-add-task:focus-within .mandal-task-quick-add-button,
.mandal-matrix .is-quick-add-task:focus-within .mandal-task-quick-add-button,
.mandal-task-quick-add-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.mandal-task-quick-add-button:hover,
.mandal-task-quick-add-button:focus-visible {
  background: #1c2f42;
  outline: none;
}

.mandal-art-grid-container .cell.highlighted {
  box-shadow: 0 0 0 3px rgba(255, 221, 87, 0.6), var(--mandal-cell-shadow);
  border-color: rgba(255, 221, 87, 0.8);
}

.mandal-art-grid-container .cell.is-year-goal-highlight {
  border-color: rgba(245, 158, 11, 0.82);
  box-shadow:
    0 0 0 4px rgba(245, 158, 11, 0.28),
    0 0 28px rgba(245, 158, 11, 0.34),
    0 16px 32px rgba(36, 52, 71, 0.18);
  animation: mandalYearGoalHighlight 1.35s ease-in-out 3;
  z-index: 9;
}

.mandal-art-grid-container .cell.is-year-goal-highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 20px rgba(255, 248, 214, 0.42);
  pointer-events: none;
  z-index: 1;
}

.mandal-art-grid-container .cell.is-deep-linked,
.mandal-matrix .is-deep-linked {
  box-shadow:
    0 0 0 4px rgba(255, 217, 102, 0.2),
    0 0 22px rgba(255, 179, 64, 0.34),
    0 16px 30px rgba(17, 24, 39, 0.18);
  animation: mandalDeepLinkAura 2.4s ease-in-out infinite;
}

.mandal-art-grid-container .cell.is-deep-linked::after,
.mandal-matrix .is-deep-linked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow:
    inset 0 0 18px rgba(255, 245, 157, 0.24),
    0 0 18px rgba(255, 204, 77, 0.42);
  pointer-events: none;
  z-index: 1;
}

.mandal-art-grid-container .cell.is-deep-linked:hover,
.mandal-matrix .is-deep-linked:hover {
  box-shadow:
    0 0 0 4px rgba(255, 217, 102, 0.24),
    0 0 26px rgba(255, 179, 64, 0.4),
    0 18px 34px rgba(17, 24, 39, 0.2);
}

.mandal-art-grid-container .cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(36, 52, 71, 0.09);
}

.mandal-art-grid-container .cell.mandal-block-highlight {
  transform: translateY(-1px) scale(1.015);
  border-color: rgba(245, 158, 11, 0.58);
  box-shadow:
    0 0 0 2px rgba(245, 158, 11, 0.22),
    0 10px 22px rgba(36, 52, 71, 0.12);
  z-index: 6;
}

.mandal-art-grid-container .cell.mandal-block-highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(251, 191, 36, 0.16);
  pointer-events: none;
  z-index: 1;
}

.mandal-art-grid-container .cell.mandal-block-highlight-core {
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.36),
    0 14px 28px rgba(36, 52, 71, 0.16);
}

.mandal-art-grid-container .cell.mandal-block-highlight-source {
  transform: translateY(-2px) scale(1.025);
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.46),
    0 16px 30px rgba(36, 52, 71, 0.18);
  border-color: rgba(217, 119, 6, 0.74);
  z-index: 8;
}

.mandal-art-grid-container .cell.is-draggable,
.mandal-matrix th.is-draggable,
.mandal-matrix td.is-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mandal-art-grid-container .cell.is-draggable:active,
.mandal-matrix th.is-draggable:active,
.mandal-matrix td.is-draggable:active {
  cursor: grabbing;
}

.mandal-art-grid-container .cell.is-draggable:active,
.mandal-art-grid-container .cell.mandal-pressing,
.mandal-matrix th.is-draggable:active,
.mandal-matrix td.is-draggable:active,
.mandal-matrix th.mandal-pressing,
.mandal-matrix td.mandal-pressing {
  transform: scale(0.985);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.22), 0 12px 26px rgba(36, 52, 71, 0.14);
  border-color: rgba(20, 184, 166, 0.46);
  z-index: 12;
}

.mandal-art-grid-container .cell.mandal-dragging,
.mandal-matrix th.mandal-dragging,
.mandal-matrix td.mandal-dragging {
  opacity: 0.82;
  transform: scale(1.035);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.54), 0 18px 34px rgba(36, 52, 71, 0.22);
  border-color: rgba(20, 184, 166, 0.9);
  z-index: 24;
}

.mandal-art-grid-container .cell.mandal-drop-eligible,
.mandal-matrix th.mandal-drop-eligible,
.mandal-matrix td.mandal-drop-eligible {
  box-shadow: inset 0 0 0 2px rgba(20, 184, 166, 0.24), var(--mandal-cell-shadow);
}

.mandal-art-grid-container .cell.mandal-drop-eligible::after,
.mandal-matrix th.mandal-drop-eligible::after,
.mandal-matrix td.mandal-drop-eligible::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(20, 184, 166, 0.52);
  border-radius: 10px;
  pointer-events: none;
  z-index: 6;
}

.mandal-art-grid-container .cell.mandal-drop-into,
.mandal-matrix th.mandal-drop-into,
.mandal-matrix td.mandal-drop-into {
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.48), var(--mandal-cell-shadow);
  border-color: rgba(20, 184, 166, 0.78);
}

.mandal-art-grid-container .cell.mandal-drop-current,
.mandal-matrix th.mandal-drop-current,
.mandal-matrix td.mandal-drop-current {
  z-index: 30;
}

.mandal-art-grid-container .cell .mandal-drop-preview,
.mandal-matrix th .mandal-drop-preview,
.mandal-matrix td .mandal-drop-preview {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  min-width: 72px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.94);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
  pointer-events: none;
  z-index: 40;
}

.mandal-art-grid-container .cell.mandal-drop-before::before,
.mandal-art-grid-container .cell.mandal-drop-after::after,
.mandal-matrix th.mandal-drop-before::before,
.mandal-matrix td.mandal-drop-before::before,
.mandal-matrix th.mandal-drop-after::after,
.mandal-matrix td.mandal-drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 4px;
  border-radius: 999px;
  background: #14b8a6;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
  z-index: 8;
}

.mandal-art-grid-container .cell.mandal-drop-before::before,
.mandal-matrix th.mandal-drop-before::before,
.mandal-matrix td.mandal-drop-before::before {
  top: 6px;
}

.mandal-art-grid-container .cell.mandal-drop-after::after,
.mandal-matrix th.mandal-drop-after::after,
.mandal-matrix td.mandal-drop-after::after {
  bottom: 6px;
}

.mandal-art-grid-container .cell.mandal-drop-before::before,
.mandal-matrix th.mandal-drop-before::before,
.mandal-matrix td.mandal-drop-before::before {
  top: 8px;
  bottom: 8px;
  left: 6px;
  right: auto;
  width: 4px;
  height: auto;
}

.mandal-art-grid-container .cell.mandal-drop-after::after,
.mandal-matrix th.mandal-drop-after::after,
.mandal-matrix td.mandal-drop-after::after {
  top: 8px;
  bottom: 8px;
  left: auto;
  right: 6px;
  width: 4px;
  height: auto;
}

body.mandal-pointer-drag-active,
body.mandal-pointer-drag-active * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
}

@keyframes mandalDeepLinkAura {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(255, 217, 102, 0.18),
      0 0 18px rgba(255, 179, 64, 0.28),
      0 16px 30px rgba(17, 24, 39, 0.16);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(255, 217, 102, 0.26),
      0 0 30px rgba(255, 179, 64, 0.46),
      0 18px 34px rgba(17, 24, 39, 0.2);
  }
}

@keyframes mandalYearGoalHighlight {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 0 4px rgba(245, 158, 11, 0.24),
      0 0 22px rgba(245, 158, 11, 0.28),
      0 16px 30px rgba(36, 52, 71, 0.16);
  }
  50% {
    transform: translateY(-2px) scale(1.018);
    box-shadow:
      0 0 0 6px rgba(245, 158, 11, 0.34),
      0 0 34px rgba(245, 158, 11, 0.42),
      0 18px 34px rgba(36, 52, 71, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mandal-art-grid-container .cell.is-year-goal-highlight {
    animation: none;
  }
}

.mandal-art-matrix-container {
  position: relative;
  width: min(100%, var(--mandal-board-size));
}

.mandal-tree-view-host {
  position: relative;
  width: min(100%, 1280px);
  min-height: calc(100vh - 150px);
  display: flex;
  overflow: hidden;
  border: 1px solid var(--mandal-card-border);
  border-radius: 26px;
  background: var(--mandal-card-bg);
  box-shadow: var(--mandal-card-shadow);
}

.mandal-tree-view-host.is-hidden {
  display: none;
}

.mandal-tree-view-host.project-tree-route-shell--treetodo {
  min-height: calc(100vh - 150px);
}

.mandal-tree-view-host.project-tree-route-shell--treetodo .app-shell {
  width: 100%;
  min-height: 0;
  height: auto;
  padding: 16px;
}

.mandal-tree-view-host.project-tree-route-shell--treetodo .canvas-hud {
  top: 56px;
  right: 48px;
  left: auto;
}

.mandal-tree-view-host__error {
  margin: auto;
  color: #7f8b99;
  font-weight: 700;
}

.mandal-matrix th,
.mandal-matrix td {
  position: relative;
}

.mandal-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: var(--mandal-board-gap);
  background: var(--mandal-card-bg);
  border: 1px solid var(--mandal-card-border);
  border-radius: 26px;
  box-shadow: var(--mandal-card-shadow);
  padding: var(--mandal-board-padding);
  table-layout: fixed;
}

.mandal-matrix thead th {
  border: none;
  padding: 0;
  background: transparent;
  font-weight: 700;
  width: auto;
  height: calc(var(--mandal-cell-size) * 0.32);
  line-height: calc(var(--mandal-cell-size) * 0.32);
  overflow: hidden;
  color: #697684;
}

.mandal-matrix tbody th {
  border: 1px solid var(--mandal-border-color);
  border-radius: 16px;
  background: #ffffff;
  padding: 0;
  text-align: left;
  vertical-align: top;
  width: auto;
  height: var(--mandal-grid-track-size);
  overflow: hidden;
  box-shadow: var(--mandal-cell-shadow);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mandal-matrix tbody th::-webkit-scrollbar {
  display: none;
}

.mandal-matrix-label {
  color: inherit;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.mandal-matrix-label::-webkit-scrollbar {
  display: none !important;
}

.mandal-matrix td {
  border: 1px solid var(--mandal-border-color);
  border-radius: 16px;
  padding: 0;
  width: auto;
  height: var(--mandal-grid-track-size);
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--mandal-cell-shadow);
  vertical-align: top;
}

.mandal-matrix td textarea {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  color: #5d6570;
}

.mandal-timer-panel {
  position: fixed;
  top: 118px;
  right: 28px;
  width: 320px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 44px rgba(15, 23, 40, 0.14);
  z-index: 8;
}

.project-gamification-panel {
  position: fixed;
  right: 28px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  width: 368px;
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 44px rgba(15, 23, 40, 0.14);
  z-index: 7;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-gamification-panel::-webkit-scrollbar {
  display: none;
}

.project-gamification-panel.is-hidden {
  display: none;
}

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

.project-gamification__header-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-gamification__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7b8c;
}

.project-gamification__title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
  color: #1f2c39;
}

.project-gamification__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.project-gamification__progress {
  display: grid;
  gap: 6px;
}

.project-gamification__progress.is-hidden,
.project-gamification__stats.is-hidden,
.project-gamification__leaderboard.is-hidden {
  display: none;
}

.project-gamification__progress-header,
.project-gamification__leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-gamification__progress-label,
.project-gamification__leaderboard-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2c39;
}

.project-gamification__progress-value {
  font-size: 0.8rem;
  color: #6b7b8c;
}

.project-gamification__progress-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(225, 232, 241, 0.98), rgba(214, 223, 234, 0.98));
}

.project-gamification__progress-fill {
  display: block;
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #89a9d2 0%, #7897c0 100%);
  transition: width 220ms ease;
}

.project-gamification__progress-meta {
  margin: 0;
  color: #6b7b8c;
  font-size: 0.76rem;
  line-height: 1.35;
  font-weight: 700;
}

.project-gamification__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.project-gamification__stat-card {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, #f8fbff, #f2f6fd);
  display: grid;
  gap: 6px;
  min-height: 84px;
  align-content: start;
}

.project-gamification__stat-label {
  min-width: 0;
  font-size: 0.69rem;
  line-height: 1.28;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b7b8c;
}

.project-gamification__stat-value {
  min-width: 0;
  font-size: 1.2rem;
  line-height: 1;
  color: #1f2c39;
  overflow-wrap: anywhere;
}

.project-gamification__leaderboard {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  margin-top: 4px;
}

.project-gamification__leaderboard-count {
  min-width: 28px;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #f4f7fb;
  color: #6b7b8c;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.project-gamification__leaderboard-note {
  margin: -4px 0 0;
  color: #6b7b8c;
  font-size: 0.74rem;
  line-height: 1.35;
  font-weight: 600;
}

.project-gamification__leaderboard-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.project-gamification__leaderboard-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 251, 255, 0.84);
}

.project-gamification__leaderboard-item.is-today {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.18);
}

.project-gamification__leaderboard-item.is-podium-1 {
  background: linear-gradient(180deg, rgba(255, 248, 219, 0.94), rgba(255, 253, 241, 0.98));
  border-color: rgba(234, 179, 8, 0.36);
  box-shadow: 0 8px 20px rgba(234, 179, 8, 0.12);
}

.project-gamification__leaderboard-item.is-podium-2 {
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.94), rgba(255, 255, 255, 0.98));
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.12);
}

.project-gamification__leaderboard-item.is-podium-3 {
  background: linear-gradient(180deg, rgba(255, 240, 231, 0.94), rgba(255, 250, 246, 0.98));
  border-color: rgba(194, 120, 76, 0.3);
  box-shadow: 0 8px 20px rgba(194, 120, 76, 0.12);
}

.project-gamification__leaderboard-item.is-latest {
  background: rgba(20, 148, 92, 0.08);
  border-color: rgba(20, 148, 92, 0.24);
  box-shadow: 0 0 0 1px rgba(20, 148, 92, 0.08);
}

.project-gamification__rank {
  font-size: 0.82rem;
  font-weight: 800;
  color: #2563eb;
  white-space: nowrap;
}

.project-gamification__leaderboard-item.is-podium-1 .project-gamification__rank {
  color: #a16207;
}

.project-gamification__leaderboard-item.is-podium-2 .project-gamification__rank {
  color: #475569;
}

.project-gamification__leaderboard-item.is-podium-3 .project-gamification__rank {
  color: #9a3412;
}

.project-gamification__item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-gamification__item-title {
  font-size: 0.9rem;
  color: #1f2c39;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-gamification__item-accuracy {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #245eb5;
  font-size: 0.72rem;
  font-weight: 700;
}

.project-gamification__item-meta {
  font-size: 0.76rem;
  color: #6b7b8c;
  line-height: 1.35;
}

.project-gamification__empty {
  margin: 0;
  font-size: 0.86rem;
  color: #6b7b8c;
}

.mandal-progress-view {
  width: min(100%, var(--mandal-board-size));
  min-height: min(var(--mandal-board-size), calc(100vh - 160px));
  max-height: calc(100vh - 130px);
  padding: 18px;
  border: 1px solid var(--mandal-card-border);
  border-radius: 24px;
  background: var(--mandal-card-bg);
  box-shadow: var(--mandal-card-shadow);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mandal-progress-view::-webkit-scrollbar {
  display: none;
}

.mandal-progress-view.is-hidden {
  display: none;
}

.mandal-progress-view__inner,
.mandal-progress-panel-content,
.project-progress-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.mandal-progress-view__inner,
.mandal-progress-panel-content {
  gap: 14px;
}

.project-progress-section {
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.82);
}

.project-progress-section__header h4 {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}

.test-week-empty {
  padding: 13px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.test-week-project-trend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.mandal-progress-view .test-week-project-trend {
  display: flex;
}

.test-week-project-trend__legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.test-week-project-trend__legend-item {
  display: grid;
  grid-template-columns: 22px 9px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.92);
}

.test-week-project-trend__legend-rank {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: #315174;
  font-size: 10px;
  font-weight: 900;
}

.test-week-project-trend__legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.test-week-project-trend__legend-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.test-week-project-trend__legend-value {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.test-week-project-trend__legend-delta,
.test-week-project-trend__legend-deadline,
.test-week-project-trend__legend-remaining {
  grid-column: 3 / -1;
  justify-self: start;
  margin-top: -4px;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.test-week-project-trend__legend-delta {
  color: #0891b2;
}

.test-week-project-trend__legend-deadline {
  color: #be123c;
}

.test-week-project-trend__chart {
  position: relative;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.mandal-progress-view .test-week-project-trend__chart {
  width: 100%;
}

.test-week-project-trend__svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.test-week-project-trend__gridline line,
.test-week-project-trend__x-label line {
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.test-week-project-trend__gridline text,
.test-week-project-trend__x-label text {
  fill: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.test-week-project-trend__elapsed-band {
  fill: rgba(100, 116, 139, 0.075);
}

.test-week-project-trend__deadline line {
  stroke: #111827;
  stroke-width: 1.8;
  stroke-dasharray: 4 4;
  opacity: 0.7;
}

.test-week-project-trend__deadline path {
  fill: #111827;
  opacity: 0.92;
}

.test-week-project-trend__deadline-label,
.test-week-project-trend__delta {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 4px;
  stroke-linejoin: round;
  font-size: 10px;
  font-weight: 900;
}

.test-week-project-trend__deadline-label {
  fill: #111827;
}

.test-week-project-trend__series polyline {
  filter: drop-shadow(0 5px 6px rgba(15, 23, 42, 0.1));
  transition: stroke-width 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.test-week-project-trend.has-key-highlight .test-week-project-trend__series:not(.is-key-highlighted) {
  opacity: 0.22;
}

.test-week-project-trend__series.is-key-highlighted polyline:not(.test-week-project-trend__hitline) {
  stroke-width: 5;
  filter: drop-shadow(0 8px 10px rgba(15, 23, 42, 0.2));
}

.test-week-project-trend__series .test-week-project-trend__hitline {
  filter: none;
  pointer-events: stroke;
}

.test-week-project-trend__series:hover polyline,
.test-week-project-trend__series:focus polyline {
  stroke-width: 5;
  filter: drop-shadow(0 8px 10px rgba(15, 23, 42, 0.18));
}

.test-week-project-trend__series:hover .test-week-project-trend__hitline,
.test-week-project-trend__series:focus .test-week-project-trend__hitline {
  stroke-width: 18;
  filter: none;
}

.test-week-project-trend__point circle {
  stroke: #ffffff;
  stroke-width: 2;
  filter: drop-shadow(0 4px 7px rgba(15, 23, 42, 0.14));
}

.test-week-project-trend__delta {
  fill: #0f172a;
}

.test-week-project-trend__tooltip {
  position: fixed;
  z-index: 5;
  max-width: min(260px, calc(100% - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
  pointer-events: none;
  transform: translateY(-4px);
}

.test-week-project-trend__tooltip[hidden] {
  display: none;
}

.test-week-project-trend__tooltip-title {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.test-week-project-trend__tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(226, 232, 240, 0.92);
  font-size: 11px;
  font-weight: 750;
}

.test-week-project-trend__tooltip-row strong {
  color: #ffffff;
  white-space: nowrap;
}

.test-week-project-trend__tooltip-divider {
  height: 1px;
  margin: 8px 0;
  background: rgba(226, 232, 240, 0.18);
}

.test-week-project-trend__tooltip-meta {
  color: rgba(226, 232, 240, 0.88);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.test-week-project-trend__key {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 7px;
}

.test-week-project-trend__key-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.test-week-project-trend__key-item:hover,
.test-week-project-trend__key-item:focus-visible {
  border-color: rgba(96, 165, 250, 0.72);
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.12);
  outline: none;
}

.test-week-project-trend__key-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 3px;
}

.test-week-project-trend__key-name {
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-week-risk-matrix {
  --test-week-risk-cell-size: 86px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mandal-progress-view .test-week-risk-matrix {
  --test-week-risk-cell-size: 92px;
}

.test-week-risk-row {
  display: grid;
  grid-template-columns: var(--test-week-risk-cell-size) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e4ebf3;
}

.test-week-risk-row__project {
  appearance: none;
  display: flex;
  align-items: flex-start;
  width: var(--test-week-risk-cell-size);
  height: var(--test-week-risk-cell-size);
  padding: 9px 8px;
  border: 1px solid var(--test-week-project-color, #94a3b8);
  border-radius: 10px;
  background: var(--test-week-project-color, #94a3b8);
  color: var(--test-week-project-text-color, #ffffff);
  font: inherit;
  text-align: left;
}

.test-week-risk-row__project-name,
.test-week-risk-todo__title {
  display: -webkit-box;
  overflow: hidden;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.test-week-risk-row__project-name {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.test-week-risk-row__todos {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--test-week-risk-cell-size));
  gap: 8px;
}

.test-week-risk-todo {
  position: relative;
  display: flex;
  align-items: flex-start;
  width: var(--test-week-risk-cell-size);
  height: var(--test-week-risk-cell-size);
  padding: 17px 8px 9px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #ffffff;
  color: inherit;
  font: inherit;
  text-align: left;
}

.test-week-risk-todo.is-risk-overdue {
  border-color: rgba(220, 38, 38, 0.48);
  background: #fee2e2;
}

.test-week-risk-todo.is-risk-due-today {
  border-color: rgba(234, 88, 12, 0.48);
  background: #ffedd5;
}

.test-week-risk-todo.is-risk-due-soon {
  border-color: rgba(245, 158, 11, 0.52);
  background: #fff0d4;
}

.test-week-risk-todo.is-risk-upcoming {
  border-color: rgba(234, 179, 8, 0.45);
  background: #fef9c3;
}

.test-week-risk-todo.is-risk-procrastinated {
  border-color: rgba(124, 58, 237, 0.28);
  background: #f5f3ff;
}

.test-week-risk-todo__badges {
  position: absolute;
  top: 0;
  right: 6px;
  display: inline-flex;
  gap: 3px;
  transform: translateY(-45%);
}

.test-week-risk-todo__title {
  width: 100%;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.18;
}

.test-week-risk-todo__quick-add {
  appearance: none;
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(44, 62, 80, 0.14);
  border-radius: 50%;
  background: #2c3e50;
  box-shadow: 0 10px 22px rgba(44, 62, 80, 0.2);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.88);
  transition: opacity 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.test-week-risk-todo:hover .test-week-risk-todo__quick-add,
.test-week-risk-todo:focus-within .test-week-risk-todo__quick-add,
.test-week-risk-todo__quick-add:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.test-week-risk-todo__quick-add:hover,
.test-week-risk-todo__quick-add:focus-visible {
  background: #1c2f42;
  outline: none;
}

.test-week-risk-todo__quick-add:disabled {
  cursor: wait;
  opacity: 0.7;
}

.test-week-overrun__risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.34);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.test-week-overrun__risk-badge--deadline-overdue {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.36);
}

.test-week-overrun__risk-badge--deadline-today {
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.36);
}

.test-week-overrun__risk-badge--deadline-soon,
.test-week-overrun__risk-badge--deadline-upcoming {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.36);
}

.test-week-overrun__risk-badge--procrastination {
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
  background: #faf7ff;
}

.mandal-timer-panel.is-hidden {
  display: none;
}

.mandal-timer-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.mandal-timer-panel__eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7b8c;
}

.mandal-timer-panel__title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
  color: #1f2c39;
}

.mandal-timer-panel__close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.mandal-timer-panel__hero {
  padding: 14px 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, #f8fbff, #f2f6fd);
}

.mandal-timer-panel__status-copy {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  color: #25384c;
}

.mandal-timer-panel__time-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.mandal-timer-panel__elapsed {
  font-size: 2rem;
  line-height: 1;
  color: #1f2c39;
}

.mandal-timer-panel[data-state="warning"] .mandal-timer-panel__elapsed,
.mandal-timer-panel[data-state="warning"] .mandal-timer-panel__delta-copy {
  color: #d97706;
}

.mandal-timer-panel[data-state="over"] .mandal-timer-panel__elapsed,
.mandal-timer-panel[data-state="over"] .mandal-timer-panel__delta-copy {
  color: #dc2626;
}

.mandal-timer-panel[data-state="done"] .mandal-timer-panel__elapsed,
.mandal-timer-panel[data-state="done"] .mandal-timer-panel__delta-copy {
  color: #0f9b6c;
}

.mandal-timer-panel__estimated-inline {
  font-size: 0.96rem;
  font-weight: 600;
  color: #6b7b8c;
}

.mandal-timer-panel__delta-copy {
  margin: 12px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2563eb;
}

.mandal-timer-panel__progress {
  margin: 18px 0;
}

.mandal-timer-panel__progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.mandal-timer-panel__progress-caption,
.mandal-timer-panel__progress-percent {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7b8c;
}

.mandal-timer-panel__progress-stack {
  display: grid;
  gap: 8px;
}

.mandal-timer-panel__bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f8;
}

.mandal-timer-panel__bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 240ms ease, background 240ms ease;
}

.mandal-timer-panel__bar-fill.is-warning {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.mandal-timer-panel__bar-fill.is-over {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.mandal-timer-panel__bar-fill.is-done {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.mandal-timer-panel__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.mandal-timer-meta {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #f8fbff;
}

.mandal-timer-meta__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.76rem;
  color: #6b7b8c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mandal-timer-meta__value {
  font-size: 1rem;
  color: #1f2c39;
}

.mandal-timer-panel__footer {
  display: flex;
  gap: 10px;
}

.mandal-timer-panel__history {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #fbfcfe;
}

.mandal-timer-panel__history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mandal-timer-panel__history-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7b8c;
}

.mandal-timer-panel__history-list {
  display: grid;
  gap: 8px;
  max-height: 132px;
  overflow-y: auto;
}

.mandal-timer-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.9);
}

.mandal-timer-history__date {
  font-size: 0.86rem;
  color: #475569;
}

.mandal-timer-history__value {
  font-size: 0.9rem;
  color: #1f2c39;
}

.mandal-timer-history__empty {
  font-size: 0.86rem;
  color: #94a3b8;
  text-align: center;
  padding: 8px 0;
}

.mandal-timer-panel__secondary,
.mandal-timer-panel__primary {
  flex: 1;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-weight: 700;
  cursor: pointer;
}

.mandal-timer-panel__secondary {
  background: #ffffff;
  color: #334155;
}

.mandal-timer-panel__secondary.is-running {
  background: #eef5ff;
}

.mandal-timer-panel__secondary.is-paused {
  background: #f8fbff;
}

.mandal-timer-panel__primary {
  background: linear-gradient(135deg, #159a68 0%, #0f8a5c 100%);
  color: #ffffff;
}

.mandal-timer-panel__primary:disabled,
.mandal-timer-panel__secondary:disabled {
  opacity: 0.45;
  cursor: default;
}

.mandal-matrix td textarea::-webkit-scrollbar {
  display: none;
}

.mandal-matrix td.completed {
  position: relative;
}

.mandal-matrix td.completed .checkmark {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1.05em;
  color: #ffffff;
  user-select: none;
  pointer-events: none;
  z-index: 5;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #178754;
  box-shadow: 0 2px 6px rgba(23, 135, 84, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mandal-art-context-menu {
  position: fixed;
  display: none;
  background-color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(44, 62, 80, 0.1);
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(24, 40, 56, 0.16);
  padding: 6px 0;
  z-index: 1000;
  font-size: 14px;
  backdrop-filter: blur(16px);
}

.mandal-art-context-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mandal-art-context-menu li {
  padding: 10px 20px;
  cursor: pointer;
  white-space: nowrap;
}

.mandal-art-context-menu li label {
  cursor: pointer;
}

.mandal-art-context-menu li:hover {
  background-color: rgba(44, 62, 80, 0.06);
}

.mandal-art-context-menu li[data-action="delete-mandal"]:hover,
.mandal-art-context-menu li[data-action="delete-content"]:hover {
  background-color: var(--mandal-danger-color);
}

#mandal-color-picker {
  visibility: hidden;
  width: 0;
  height: 0;
  position: absolute;
}

.mandal-add-modal-backdrop,
.mandal-edit-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 33, 44, 0.28);
  backdrop-filter: blur(8px);
}

.mandal-add-modal {
  width: min(100%, 390px);
  border: 1px solid rgba(44, 62, 80, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 48px rgba(24, 40, 56, 0.22);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mandal-add-modal h2 {
  margin: 0;
  color: #25384c;
  font-size: 1.18rem;
  line-height: 1.25;
}

.mandal-add-modal label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #445260;
  font-size: 0.86rem;
  font-weight: 700;
}

.mandal-add-modal input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(44, 62, 80, 0.16);
  border-radius: 10px;
  padding: 9px 11px;
  color: #25384c;
  font: inherit;
  font-weight: 600;
  box-sizing: border-box;
  outline: none;
  background: #ffffff;
}

.mandal-add-modal select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(44, 62, 80, 0.16);
  border-radius: 10px;
  padding: 9px 11px;
  color: #25384c;
  font: inherit;
  font-weight: 600;
  box-sizing: border-box;
  outline: none;
  background: #ffffff;
}

.mandal-add-modal input:focus {
  border-color: #25384c;
  box-shadow: 0 0 0 3px rgba(37, 56, 76, 0.12);
}

.mandal-add-modal select:focus {
  border-color: #25384c;
  box-shadow: 0 0 0 3px rgba(37, 56, 76, 0.12);
}

.mandal-add-modal__error {
  min-height: 18px;
  color: #c23535;
  font-size: 0.82rem;
  line-height: 1.3;
  font-weight: 700;
}

.mandal-add-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.mandal-add-modal__actions button {
  min-width: 74px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(44, 62, 80, 0.14);
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mandal-add-modal__cancel {
  background: #ffffff;
  color: #445260;
}

.mandal-add-modal__reset {
  margin-right: auto;
  background: #fff5f5;
  color: #c23535;
  border-color: rgba(194, 53, 53, 0.22) !important;
}

.mandal-add-modal__delete {
  background: #fff5f5;
  color: #c23535;
  border-color: rgba(194, 53, 53, 0.22) !important;
}

.mandal-delete-modal {
  gap: 12px;
}

.mandal-deadline-modal__reset-warning {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff5f5;
  color: #8f2d2d;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 700;
}

.mandal-delete-modal__message {
  margin: -2px 0 18px;
  color: #5d6b78;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
}

.mandal-add-modal__submit {
  background: #25384c;
  color: #ffffff;
}

.mandal-add-modal__actions button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

@media (min-width: 1280px) {
  :root {
    --mandal-board-size: min(calc(100vh - 165px), calc(100vw - 80px), 980px);
  }

  .mandal-art-toolbar,
  .mandal-art-grid-container,
  .mandal-art-matrix-container,
  .mandal-progress-view {
    width: var(--mandal-board-size);
  }

  .mandal-art-grid-container {
    height: var(--mandal-board-size);
  }

  .mandal-matrix {
    border-spacing: 7px;
    padding: 12px;
  }

  .mandal-matrix thead th {
    height: calc(var(--mandal-grid-track-size) * 0.28);
    line-height: calc(var(--mandal-grid-track-size) * 0.28);
  }

  .mandal-matrix tbody th,
  .mandal-matrix td {
    height: var(--mandal-grid-track-size);
  }
}

@media (max-width: 1200px) {
  .mandal-art-sidebar {
    width: 240px;
  }

  .mandal-art-main-content {
    padding: 20px;
  }

  .mandal-art-grid-container {
    width: min(92vw, 90vh);
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .mandal-progress-view {
    width: min(92vw, 90vh);
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  :root {
    --mandal-board-size: min(calc(100vw - 96px), calc(100vh - 125px));
  }

  .mandal-art-sidebar {
    width: 220px;
    padding: 16px 18px;
  }

  .mandal-art-sidebar h2 {
    font-size: 1.15rem;
  }

  .mandal-art-sidebar #mandal-list li {
    padding: 13px 12px;
    margin-bottom: 8px;
    font-size: 0.95rem;
  }

  .mandal-art-main-content {
    padding: 14px 16px 16px;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas: "toolbar board";
    column-gap: 12px;
    align-items: start;
    justify-items: center;
  }

  .mandal-art-toolbar {
    grid-area: toolbar;
    width: 64px;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
  }

  .mandal-art-toolbar button {
      width: 64px;
      min-height: 40px;
      padding: 8px 0;
      font-size: 0.74rem;
      line-height: 1.15;
  }

  .mandal-art-breadcrumb {
    width: 64px;
    max-width: 64px;
    min-height: 0;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    order: -1;
    margin: 0 0 2px;
  }

  .mandal-art-breadcrumb__separator {
    display: none;
  }

  .mandal-art-breadcrumb__item {
    max-width: 64px;
    font-size: 0.62rem;
  }

  .mandal-art-grid-container {
    grid-area: board;
    width: min(100%, var(--mandal-board-size));
    aspect-ratio: 1 / 1;
    height: auto;
    padding: 14px;
    gap: 6px;
    border-radius: 22px;
  }

  .mandal-art-grid-container .cell.border-right-bold {
    margin-right: 0;
  }

  .mandal-art-grid-container .cell.border-bottom-bold {
    margin-bottom: 0;
  }

  .mandal-art-grid-container .cell textarea,
  .mandal-matrix-label,
  .mandal-matrix td textarea {
    padding: 9px 8px;
    font-size: 0.8rem;
    line-height: 1.14;
  }

  .mandal-art-matrix-container {
    grid-area: board;
    width: min(100%, calc(var(--mandal-board-size) + 156px));
  }

  .mandal-progress-view {
    grid-area: board;
    width: min(100%, calc(var(--mandal-board-size) + 156px));
  }

  .mandal-matrix {
    border-spacing: 7px;
    padding: 14px;
  }

  .mandal-matrix tbody th,
  .mandal-matrix td {
    height: calc(var(--mandal-cell-size) * 1.12);
  }
}

@media (max-width: 900px) {
  .mandal-art-content-wrapper {
    flex-direction: column;
  }

  .mandal-art-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(44, 62, 80, 0.08);
  }

  .mandal-art-main-content {
    padding: 16px;
  }

  .mandal-art-toolbar,
  .mandal-art-matrix-container,
  .mandal-progress-view {
    width: 100%;
  }

  .mandal-art-breadcrumb {
    min-width: 0;
    max-width: none;
    margin: 0 auto 0 0;
  }

  .mandal-art-breadcrumb__item {
    max-width: 112px;
  }

  .mandal-art-grid-container {
    width: min(100%, 92vw);
    height: min(100vw, 92vw);
    padding: 12px;
    gap: 6px;
    border-radius: 20px;
  }

  .mandal-progress-view {
    max-height: none;
    min-height: 0;
    padding: 12px;
    border-radius: 20px;
  }

  .mandal-progress-view .test-week-project-trend {
    display: flex;
  }

  .mandal-art-grid-container .cell.border-right-bold {
    margin-right: 6px;
  }

  .mandal-art-grid-container .cell.border-bottom-bold {
    margin-bottom: 6px;
  }

  .project-gamification-panel {
    right: 12px;
    left: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: min(44vh, 420px);
    transform: none;
  }
}
