.puspn-table-container {
  padding: 20px;
  background: white;
  min-height: 100vh;
}

/* 7P About login button */
.puspn-about-loginbtn {
  background-color: var(--bb-primary-button-background-regular) !important;
  color: var(--bb-primary-button-text-regular) !important;
  border-radius: 7px !important;
  font-size: 16px !important;
  min-height: 32px !important;
  line-height: 32px !important;
  padding: 0 18px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0 !important;
  font-weight: 600 !important;
  transition: background-color 0.2s ease !important;
}

.puspn-about-loginbtn:hover,
.puspn-about-loginbtn:focus {
  background-color: var(--bb-primary-button-background-hover) !important;
  color: var(--bb-primary-button-text-hover) !important;
  text-decoration: none !important;
}

.puspn-matrix-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border: none;
  overflow-x: scroll;
  display: block;
  border-radius: 0;
}
.puspn-topics-not-found.text-center, .puspn-user-not-logged-in.text-center {
    padding-top: 40px;
}
.puspn-matrix-table tr th:first-child {
    border-left: 1px solid #dddddd;
    border-right: 1px solid #dddddd;
}
.puspn-matrix-table tr th:last-child {
    border-right: 1px solid #dddddd;
}
.puspn-matrix-table tr th {
  border-top: 1px solid #dddddd;
  padding: 12px 8px;
  text-align: center;
  vertical-align: middle;
}
.puspn-matrix-table td {
  border: 1px solid #dddddd;
  padding: 3px 8px;
  text-align: center;
  vertical-align: middle;
}

.puspn-matrix-table thead th {
  padding: 15px 8px 10px;
  background: white;
  font-weight: normal;
}

.puspn-matrix-table .puspn-col-life {
  width: 280px;
  background: white;
  border-right: none;
}

.puspn-matrix-table .puspn-col-passion {
    width: 60px;
    background: white;
    padding: 0;
    border-right: none;
}
.puspn-passion-icon img {
    width: 48px;
    min-width: 48px;
}
.puspn-col-passion .puspn-icon-label {
    font-size: 14px !important;
}
.puspn-matrix-table .puspn-col-unity .puspn-icon-wrapper {
  background: #ffeeff;
}

.puspn-matrix-table .puspn-col-wisdom .puspn-icon-wrapper {
  background: #eeeeff;
}

.puspn-matrix-table .puspn-col-creativity .puspn-icon-wrapper {
  background: #ddffff;
}

.puspn-matrix-table .puspn-col-love .puspn-icon-wrapper {
  background: #eeffee;
}

.puspn-matrix-table .puspn-col-power .puspn-icon-wrapper {
  background: #ffffdd;
}

.puspn-matrix-table .puspn-col-joy .puspn-icon-wrapper {
  background: #fff8e8;
}

.puspn-matrix-table .puspn-col-peace .puspn-icon-wrapper {
  background: #ffeeee;
}

/* Cell background colors for body rows */
.puspn-matrix-table .puspn-col-passion-cell {
  background: white;
}

.puspn-matrix-table .puspn-col-unity-cell {
  background: #ffeeff;
}

.puspn-matrix-table .puspn-col-wisdom-cell {
  background: #eeeeff;
}

.puspn-matrix-table .puspn-col-creativity-cell {
  background: #ddffff;
}

.puspn-matrix-table .puspn-col-love-cell {
  background: #eeffee;
}

.puspn-matrix-table .puspn-col-power-cell {
  background: #ffffdd;
}

.puspn-matrix-table .puspn-col-joy-cell {
  background: #fff8e8;
}

.puspn-matrix-table .puspn-col-peace-cell {
  background: #ffeeee;
}

.puspn-matrix-table .puspn-row-number {
  width: 30px;
  font-size: 16px;
  color: #333;
  background: white;
}

.puspn-matrix-table .puspn-row-label {
  text-align: left;
  padding-left: 5px;
  font-size: 15px;
  color: #333;
  background: white;
  min-width: 200px;
  position: relative;
}
.puspn-matrix-table tbody tr, .puspn-matrix-table thead tr.puspn-fixed-row {
  height: 55px;
}
.puspn-matrix-table thead tr:nth-child(1) th:not(:nth-child(1)):not(:nth-child(2)) {
  padding: 0;
  max-width: 55px;
  min-width: 55px;
  position: relative;
}
.puspn-matrix-table thead tr:nth-child(1) th:not(:nth-child(1)):not(:nth-child(2)) a {
    border-top: 1px solid #dddddd;
    padding: 5px 5px 0px;
    margin-top: 18px;
    max-width: 55px;
    min-width: 54px;
    display: flex;
    overflow: hidden;
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 0px;
    cursor: default;
    pointer-events: none;
}
.puspn-matrix-table thead tr:nth-child(1) th:nth-child(3) a {
    /* border-left: 1px solid #000000; */
}
.puspn-matrix-table tbody tr:nth-child(1) td {
    border-bottom: 1px solid #000000 !important;
}
.puspn-col-passion a {
    padding: 0 5px;
    margin-top: 15px;
    cursor: default;
    pointer-events: none;
}
.puspn-matrix-table thead tr:nth-child(1) th:not(:nth-child(1)):not(:nth-child(2)) img {
    width: 40px;
    min-width: 40px;
}
.puspn-icon-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.puspn-icon-label {
  font-size: 12px;
  color: #333;
  font-weight: normal;
}
.puspn-col-creativity.puspn-col-th-child a .puspn-icon-label,
.puspn-col-wisdom.puspn-col-th-child a .puspn-icon-label {
  font-size: 10px;
}
.puspn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.puspn-clickable-cell {
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease, filter 0.2s ease;
    width: 55px;
    height: 55px;
    min-width: 55px;
}

.puspn-cell-has-note::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 10px 10px;
  border-color: transparent transparent #888888 transparent;
  opacity: 0.85;
  pointer-events: none;
}

.puspn-cell-has-note:hover::after {
  border-color: transparent transparent #000000 transparent;
}

.puspn-clickable-cell:hover {
  filter: brightness(0.95);
}


/* Topic text and edit icon container */
.puspn-row-label {
  display: table-cell;
  position: relative;
}

/* Edit icon */
.puspn-edit-icon {
    position: absolute;
    top: 0px;
    right: 20px;
    width: 20px;
    height: 20px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #000000;
    transition: opacity 0.2s, background-color 0.2s;
    opacity: 0;
    pointer-events: none;
}
button.puspn-remove-icon {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 20px;
    height: 20px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #000000;
    transition: opacity 0.2s, background-color 0.2s;
    opacity: 0;
    pointer-events: none;
}
.puspn-row-label:hover .puspn-edit-icon,
.puspn-row-label:hover .puspn-remove-icon,
.puspn-row-label:focus-within .puspn-edit-icon,
.puspn-row-label:focus-within .puspn-remove-icon,
.puspn-edit-icon:focus,
.puspn-remove-icon:focus {
    opacity: 1;
    pointer-events: auto;
}
.puspn-remove-icon:hover {
    background-color: #ffffff;
    color: #ff0000;
}
.puspn-remove-icon:focus {
    outline: none;
    background-color: #ffffff;
    color: #000000;
}
.puspn-edit-icon:hover {
    background-color: #ffffff;
    color: #ff0000;
}

/* Edit input */
.puspn-topic-edit-input {
  flex: 1;
  padding: 4px 8px;
  font-size: 15px;
  border: 2px solid #848484;
  border-radius: 4px;
  outline: none;
  font-family: Arial, sans-serif;
}

/* Drag handle (row number cell) */
.puspn-drag-handle {
  cursor: grab;
  user-select: none;
  transition: background-color 0.2s;
}

.puspn-drag-handle:hover {
  background: #f0f0f0;
}

.puspn-drag-handle:active {
  cursor: grabbing;
}

/* Draggable rows */
.puspn-draggable-row {
  transition: background-color 0.2s;
}

.puspn-draggable-row.puspn-dragging {
  opacity: 0.5;
  background: #e8e8e8;
}

.puspn-draggable-row.puspn-drag-over {
  border-top: 3px solid #848484;
}

.puspn-draggable-row.puspn-drag-over-bottom {
  border-bottom: 3px solid #848484;
}

/* Add Topic */
.puspn-add-topic-button button {
    padding: 8px 12px;
    font-size: 16px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 19%;
    min-width: 100px;
}

.puspn-add-topic-input input {
    padding: 10px 12px;
    font-size: 18px;
    border: 2px solid #dddddd;
    outline: none;
    font-family: Arial, sans-serif;
    width: 100%;
    min-width: 200px;
    height: 55px;
    border: none;
}
.puspn-matrix-table tfoot .puspn-row-label {
  padding: 0;
}
.puspn-add-topic-button-wrap .puspn-add-topic-button {
  padding: 0 10px;
}
.puspn-matrix-table tfoot td {
  border-right: none;
  border-bottom: 1px solid #ddd;
}
.puspn-matrix-table .puspn-col-passion-cell {
    border-right: 1px solid #000;
}
.puspn-col-overall-topic-cell {
    font-size: 25px;
    display: block;
    text-align: center;
}
.puspn-matrix-table thead tr:nth-child(1) th:not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(3))::before {
  content: "";
  position: absolute;
  height: 70px;
  width: 1px;
  background-color: #dddddd;
  top: 60.2%;
  left: -0.5px;
  transform: translateY(-50%);
}
.puspn-matrix-table thead tr:nth-child(1) th:not(:nth-child(1)):not(:nth-child(2)):nth-child(3)::before {
  content: "";
  position: absolute;
  height: 70px;
  width: 1px;
  background-color: #000000;
  top: 60.2%;
  left: -0.5px;
  transform: translateY(-50%);
}
.puspn-col-logo a {
    display: flex;
    align-items: flex-start;
    margin-left: 18px;
}

/* Popup tooltip */
.puspn-popup-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  display: none;
}

.puspn-popup-tooltip.puspn-visible {
  display: block;
}

.puspn-popup-tooltip.puspn-hide-life-elements .puspn-popup-life-icon,
.puspn-popup-tooltip.puspn-hide-life-elements .puspn-popup-title {
  display: none;
}

.puspn-popup-container {
  position: relative;
  background: #ffffff;
  border-radius: 8px;
  width: 350px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.puspn-popup-rating-section {
    padding: 5px 9px;
}
.puspn-popup-rating-top {
  padding: 5px 9px;
  background-color: #ddd;
  border-top-left-radius: 10px;
  border-bottom: 2px solid #cccccc;
}
.puspn-popup-arrow {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 12px solid #333333;
}

.puspn-popup-close {
  position: absolute;
  top: 2px;
  right: 2px;
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.puspn-popup-life-icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.puspn-popup-close:hover {
  background-color: #dddddd;
}

.puspn-popup-content {
  border-radius: 10px;
}

.puspn-popup-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}
#puspn-popupRatingText strong {
    font-weight: 600;
}
.puspn-popup-title {
  font-size: 22px;
  font-weight: 400;
  color: #333333;
}

.puspn-popup-column-icon {
  display: flex;
  align-items: center;
}

.puspn-column-icon-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.puspn-popup-column-name {
  font-size: 22px;
  font-weight: 400;
}

.puspn-popup-area {
  font-size: 14px;
  color: #333333;
  border-bottom: 1px solid #dddddd;
  line-height: 1.2;
}

.puspn-popup-rating-text {
  font-size: 14px;
  color: #333333;
  margin-bottom: 5px;
}

.puspn-popup-parent-rating {
  display: none;
  align-items: center;
  flex-direction: column;
  width: max-content;
  line-height: 1;
}

.puspn-popup-parent-rating.is-visible {
  display: flex;
}

.puspn-parent-rating-icon img {
  width: 40px;
  height: 40px;
  display: block;
}

.puspn-parent-rating-icon.is-hidden {
  display: none;
}

.puspn-parent-rating-label {
  font-size: 12px;
  font-weight: 600;
  color: #333333;
}

.puspn-popup-rating-icons.is-hidden {
  display: none;
}

.puspn-popup-rating-icons {
  display: flex;
  gap: 5px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.puspn-rating-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: transform 0.2s ease;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.puspn-rating-btn:not(.puspn-selected):hover,
.puspn-rating-btn:not(.puspn-selected):focus-visible {
  transform: scale(1.2);
  background-color: transparent;
}

.puspn-rating-btn:focus-visible {
  outline: none;
  background-color: transparent;
}

.puspn-rating-btn.puspn-selected {
  background-color: transparent;
}

.puspn-rating-btn-null {
  margin-left: 10px;
}

.puspn-rating-btn-hidden {
  display: none !important;
}

.puspn-rating-icon {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.puspn-rating-label {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translate(-50%, 0);
  background: rgba(51, 51, 51, 0.95);
  color: #ffffff;
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  display: none;
  pointer-events: none;
  z-index: 5;
}

.puspn-rating-btn:not(.puspn-selected):hover .puspn-rating-label,
.puspn-rating-btn:not(.puspn-selected):focus-visible .puspn-rating-label {
  display: block;
}

.puspn-rating-btn.puspn-selected .puspn-rating-label {
  position: absolute;
  top: auto;
  bottom: -15px;
  transform: translate(-50%, 0);
  background: transparent;
  color: #333333;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  display: block;
}

.puspn-popup-notes-section {
  padding: 15px 9px 10px;
}

.puspn-popup-textarea {
  width: 100%;
  min-height: 70px;
  padding: 5px;
  border: 1px solid #dddddd;
  border-radius: 6px;
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  resize: vertical;
  background: #ffffff;
  line-height: 1.2;
}

.puspn-popup-textarea:focus {
  outline: none;
  border-color: #888888;
}

.puspn-popup-textarea::placeholder {
  color: #999999;
}

#puspn-popupAreaText {
  font-weight: 600;
}