* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Noto Sans JP', sans-serif;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f4f4;
    color: #333;
    font-size: 14px;
    width: 100%;
    margin-bottom: 5rem;
}

h2 {
    font-size: 1em;
    text-align: center;
    margin-top: 0;
}

h3 {
    text-align: center;
    margin-top: 1.5rem;
}
h4 {
    margin: 0;
}
.logo {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    height: 25px;
    z-index: 2;
}

.overlaylogo {
  height: 30px;
  position: fixed;
  top: 1rem;
  transform: translateX(-50%);
  z-index: 9;
  mix-blend-mode: difference;
  left: 50%;
  }

.note {
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

form {
    max-width: 600px;
    margin: 1rem auto;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    overflow-wrap: break-word;
}

.status-container {
    max-width: 600px;
    margin: 1rem auto 2rem auto;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-wrap: break-word;
    position: relative;
    box-shadow: 0 5px 10px rgba(0,0,0,0.05);
}

label {
    display: block;
    margin: 0.8rem 0 0.4rem;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="range"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

input[type="checkbox"] {
    margin-right: 0.5rem;
}

button, .action-button {
    background: #97a1c7;
    color: white;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    margin: 0.5rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1;
    border: 1px solid #97a1c7;
}

button:hover, .action-button:hover {
    background: #7984af;
}

button.wht, .action-button.wht {
  background: #ffffff;
  color: #7984af;
  padding: 0.6rem 1rem;
  border: 1px solid #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  margin: 0.5rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1;
}

button.wht, .sub-button.wht {
  background: none;
  border: 1px solid #fff;
  color: #fff;
}

button.wht:hover, .action-button.wht:hover {
  background: #cdd2e5;
}

.center-button {
    text-align: center;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #ccc;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0 0.3rem 0;
    z-index: 999;
}

.nav-item {
    flex: 1;
    text-align: center;
    font-size: 0.8em;
    color: #666;
    text-decoration: none;
}

.nav-item .icon {
  font-size: 1.2rem;
}

.nav-item.active {
    color: #7984af;
    font-weight: bold;
}
.nav-item.active .icon svg path,
.nav-item.active .icon svg g path {
  fill: #7984af;
}

.main-content {
    padding: 1rem;
}

.skill-entry {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    overflow: hidden;
}

.skill-entry input,
.skill-entry select {
    flex: 1;
    height: 2.2rem;
}

.skill-entry select {
    width: 5em;
    padding: 0 0.4rem;
    flex: 0;
}

.remove-button {
    background: #fff;
    color: #e75c52;
    border: 1px solid #e75c52;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    height: 2.2rem;
    cursor: pointer;
    margin: 0;
}

.remove-button:hover {
    background: #fef0ef;
}
.remove-button2 {
  background: #fff;
  color: #e75c52;
  border: 1px solid #e75c52;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  margin: 0.5rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1;
}

.remove-button2:hover {
  background: #fef0ef;
}
.sub-button {
    background: #fff;
    color: #97a1c7;
    border: 1px solid #97a1c7;
    cursor: pointer;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 1em;
    margin: 0.5rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1;
}

.sub-button:hover {
    background: #f0f3f8;
}

.tag {
    display: inline-block;
    background: #eeeeee;
    border-radius: 12px;
    padding: 0.3em 0.7em;
    font-size: 0.8rem;
    margin: 0.2em;
    word-break: break-word;
}

.info-block {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}
.info-block:last-child {
    border-bottom: 0;
}
.info-block p {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
strong {
    color: #7984af;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 12px;
    background: linear-gradient(to right, #97a1c7 0%, #97a1c7 var(--value, 50%), #ddd var(--value, 50%), #ddd 100%);
    border-radius: 5px;
    outline: none;
    padding: 0;
    margin: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #7984af;
    cursor: pointer;
    margin-top: 0px;
    border: 2px solid white;
}

input[type="range"]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #7984af;
    cursor: pointer;
    border: 2px solid white;
}

.poison-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.poison-icon {
    width: 20px;
    height: 20px;
    color: #97a1c7;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider.round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: .4s;
}

.slider.round:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider.round {
    background-color: #97a1c7;
}

.switch input:checked + .slider.round:before {
    transform: translateX(16px);
}

#vision-button {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 0.6rem;
    z-index: 999;
    text-decoration: none;
    cursor: pointer;
}
.vision-board {
    top: 4.5rem!important;
}

#vision-button svg {
    display: block;
}



#menu-button {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
  }
  
  .menu-buttons {
    position: fixed;
    top: 4.4rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    z-index: 998;
  }
  
  .menu-buttons.show {
    max-height: 200px;
    opacity: 1;
  }
  
  .menu-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
  }




.usertypeicon {
  width: 80px;
  height: 80px;
  border: 3px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  padding: 15px;
  margin: 1rem auto;
  background: linear-gradient(135deg, #a39fc8, #93a2c6, #83a5c3);
}

.slider-wrapper {
  margin-bottom: 0.25rem;
}
.label-area {
  display: flex;
  align-items: center;
  font-weight: bold;
  gap: 0.4rem;
}
.slider-label {
  flex-shrink: 0;
}
.info-icon {
    position: relative;
    cursor: pointer;
    font-size: 0.9rem;
    color: #999;
    font-weight: 500;
  }
  
  .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    top: calc(100% + 10px); /* 表示位置はJS側で設定する */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 5px;
    padding: 10px 14px;
    max-width: 90%;
    box-sizing: border-box;
    z-index: 1000;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: opacity 0.2s ease-in-out;
  }
  .info-icon.show .tooltip-text {
    visibility: visible;
    opacity: 1;
  }

.value-text {
  margin-left: auto;
  font-size: 0.9rem;
  color: #888;
  font-weight: normal;
}
.styled-slider {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: #ddd;
  appearance: none;
}
.styled-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #97a1c7;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}
.styled-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #97a1c7;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.poison-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}
.poison-icon {
  width: 16px;
  height: 16px;
}




.footer-extra {
    margin-top: 2rem;
    padding-bottom: 2rem;
    text-align: center;
  }
  
  .footer-inner {
    align-items: center;
    gap: 1rem;
  }
  
  .footer-link {
    font-size: 0.85rem;
    color: #666;
    text-decoration: underline;
  }
  
  .footer-logo {
    height: 20px;
    opacity: 0.7;
  }
  footer p {
    margin-top: 5px;
  }


  #close-btn {
    position: fixed;
    top: 1rem;
    right: 0rem;
    z-index: 2;
    background: transparent;
    border: none;
    cursor: pointer;
}
#close-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
}




.linemessage {
    width: 100%;
    background: #000000;
    color: #ffffff;
    padding: 0.25rem;
    text-align: center;
}






.popup {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
    padding: 1rem;
}
.popup-content {
    background: #fff;
    padding: 1rem;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: auto;
}
.ai-popup {
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.popup-scroll {
    overflow-y: auto;
    max-height: 60vh;
    padding-right: 0.5rem;
}
.popup-row {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.range-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    margin-top: 0.3rem;
}
.popup form {
    margin: 0;
}
.center-button {
    text-align: center;
    margin-top: 1rem;
}

.quest-wrapper {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}
.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.quest-list {
    list-style: none;
    padding-left: 0;
}
.quest-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.quest-list input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    height: 2.2rem;
    margin: 0.25rem;
    border: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}
.add-button {
    padding: 0.25rem 0.6rem;
    border: 1px solid #999;
    background: transparent;
    color: #333;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    height: 2.2rem;
    margin: 0;
}
.add-button:hover {
    background-color: #f0f0f0;
    border-color: #999;
}
.add-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.add-button:disabled:hover {
    background-color: transparent;
    border-color: #999;
}
.diff-pill {
    display: inline-block;
    background: #dd5252;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 0.5rem;
}
.image-upload-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.image-box {
    width: 80px;
    height: 80px;
    border: 2px dashed #aaa;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-box .plus {
    font-size: 1.5rem;
    color: #aaa;
}
.image-box.has-image {
    border: none;
}
.image-delete {
    position: absolute;
    top: 0;
    right: 0;
    background: #666666;
    border: 1px solid;
    color: #fff;
    font-size: 0.8rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    line-height: 0;
}

/* ▼ 以下：説明用エリアの追加スタイル ▼ */
.description-box {
    background: #f9f9f9;
    padding: 0.8rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    position: relative;
}
.desc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.edit-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #666;
    display: flex;
    align-items: center;
    padding: 3px;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}
.edit-icon:hover {
    color: #333;
    background-color: #ddd;
}
.desc-content {
    min-height: 3em;
    line-height: 1.5;
    font-size: 0.95rem;
}
.quest-composite-box {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0 0.4rem 0 0;
  background: white;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}

.quest-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quest-composite-box {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0 0.4rem 0 0;
  background: white;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}

.quest-top-row {
  display: flex;
}

.quest-composite-input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 1rem;
  background: transparent;
}

.quest-date-bottom {
  margin-top: 0;
}
.quest-date-bottom span {
  font-size: 0.7rem;
  margin: 0 0 0 1.1em;
}

.quest-date-picker {
  border: none;
  background: transparent;
  color: #333;
  cursor: pointer;
  padding: 0.4rem 0;
  box-sizing: border-box;
  margin: 0 0 0.5em 0;
  color: #7984af;
}
.quest-date-picker::-webkit-calendar-picker-indicator {
  filter: grayscale(100%);
  cursor: pointer;
}
.date-select-button {
  font-size: 0.75rem;
  color: #666;
  background: transparent;
  border: 1px dashed #aaa;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}
.date-select-button:hover {
  background: #f0f0f0;
}







#delete-confirm-popup p {
    text-align: center;
    margin: 1.5rem;
}
#delete-confirm-popup form {
    padding: 0;
}

#upload-error p {
    margin: 0;
}







#help-button {
    bottom: 80px;
    right: 20px;
    position: fixed;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
}
#help-popup {
    position: fixed;
    bottom: 130px;
    right: 20px;
    background: #000;
    padding: 5px;
    width: 290px;
    max-height: 66vh;
    overflow-y: auto;
    border-radius: 8px;
    display: none;
    z-index: 9999;
    box-sizing: border-box;
    font-family: 'DotGothic16', sans-serif;
}
#help-popup.visible {
    display: block;
}
#help-content {
    background: #000;
    color: #ffffff;
    padding: 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: calc(66vh - 10px);
    overflow-y: auto;
    box-sizing: border-box;
    border: 2px solid #ffffff;
}
#help-content strong {
    font-size: 15px;
    display: block;
    margin-bottom: 6px;
    color: #ffffff;
}







  
/* PLAN PAGE */
.timeline-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 0 1rem 1rem;
  }
  .timeline {
    border-left: 2px solid #ccc;
    padding-left: 20px;
    padding-top: 0.5rem;
    position: relative;
    max-width: 600px;
    margin: auto;
  }
  .year-marker {
    margin: 2rem 0 1rem;
    position: relative;
  }
  .year-marker::before {
    content: "";
    position: absolute;
    left: -30px;
    top: 0.3rem;
    width: 14px;
    height: 14px;
    background: #97a1c7;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #97a1c7;
  }
  .year-text {
    font-weight: bold;
    font-size: 1.2rem;
    color: #555;
  }
  .timeline-item {
    background: linear-gradient(135deg, #a39fc8, #93a2c6, #83a5c3);
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }
  .timeline-top {
    padding: 1rem;
    color: #fff;
    position: relative;
    padding-bottom: 0;
  }
  .timeline-date {
    font-size: 0.9rem;
    opacity: 0.7;
  }
  .timeline-category-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #fff;
    color: #97a1c7;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
  }
  .sub-toggle {
    text-align: center;
    background: #626b95;
    color: #fff;
    padding: 0.25rem;
    font-size: 0.9rem;
    border-top: 1px solid #ccc;
    cursor: pointer;
  }
  .sub-area {
    background: #fff;
    padding: 1rem;
    border-top: 1px solid #eee;
  }
  .sub-area form {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }
  .sub-list {
    margin-bottom: 1rem;
  }
  .sub-item {
    font-size: 0.95rem;
    padding: 0.3rem 0;
  }
  .sub-item .sub-date {
    font-size: 0.85rem;
    color: #666;
    margin-left: 0.5rem;
  }
  
  
  
  .toggle-icon {
    width: 1.5em;
    height: 1.5em;
    display: inline-block;
    margin-top: -0.25rem;
  }
  
  
  
  .timeline-item.subquest-block {
    background: #ffffff;
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }
  .timeline-item.subquest-block .timeline-top {
    padding: 1rem;
    color: #000;
    position: relative;
    padding-bottom: 0;
  }
  .timeline-item.subquest-block .timeline-date {
    font-size: 0.9rem;
    opacity: 0.7;
    opacity: 0.5;
  }
  .timeline-item.subquest-block .timeline-category-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #97a1c7;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
  }
  .timeline-item.subquest-block .timeline-text {
    margin: 0.5rem 0 0;
  }
  .subquest-block .timeline-top {
    padding-bottom: 1rem!important;
  }
  .subquest-parent-link {
    font-size: 0.85rem;
    margin-top: 0.3rem;
    color: #555;
  }
  .subquest-parent-link a {
    color: #97a1c7;
    text-decoration: underline;
  }
  
  
  .plan-tab-wrapper {
    max-width: 800px;
    margin: 1.5rem auto 0 auto;
    box-sizing: border-box;
  }
  
  .plan-tab-list {
    display: flex;
    justify-content: space-between;
    background-color: #f2f3f7;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dcdfe6;
  }
  
  .plan-tab {
    width: 25%;
    padding: 0.75rem 0;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    background-color: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    box-sizing: border-box;
    margin: 3px;
    border-radius: 8px;
    font-size: 0.8rem;
  }
  
  .plan-tab:hover {
    background-color: #e6e9f0;
  }
  
  .plan-tab.active {
    background-color: #97a1c7;
    color: #fff;
  }
  
  .month-marker {
    margin: 1rem 0 0.5rem;
    position: relative;
  }
  .month-marker::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 0.3rem;
    width: 8px;
    height: 8px;
    background: #97a1c7;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px #97a1c7;
  }
  .month-text {
    font-size: 0.85rem;
    color: #666;
  }
  
  .task-s {
    margin-bottom: 0;
    margin-left: 0;
    padding-bottom: 0;
  }
  .task-e {
    margin-top: 0;
    margin-left: 0;
    padding-top: 0;
  }
  
  
  .day-marker {
    margin: 0.5rem 0 0.5rem 0;
    position: relative;
  }
  .day-marker::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 0.3rem;
    width: 6px;
    height: 6px;
    background: #97a1c7;
    border-radius: 50%;
  }
  .day-text {
    font-size: 0.8rem;
    color: #666;
    margin-left: 0.25rem;
  }
  
  
  .today-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: bold;
    color: #fff;
    background-color: #f66;
    border-radius: 8px;
    vertical-align: middle;
  }
  
  
  
  
  #tab-content-tab3, #tab-content-tab2, #tab-content-tab4, #tab-content-tab1 {
    margin-left: -1rem;
    margin-top: 1rem;
  }
  .weekly-chart {
    overflow-x: auto;
    padding: 0 1rem 1rem 0;
  }
  .weekly-header {
    display: flex;
  }
  .left-col {
    width: 150px;
    flex-shrink: 0;
    font-size: 0.85rem;
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    left: 0;
    background: #f4f4f4;
    z-index: 3;
    transition: all 0.3s ease;
    border-right: 1px solid #eee;
  }
  .left-col.hidden {
    width: 0 !important;
    padding: 0 !important;
    border: none !important;
    visibility: hidden;
    overflow: hidden;
  }
  
  /* 基本セル */
  .cell {
    text-align: center;
    font-size: 0.75rem;
    padding: 4px 0;
    min-width: 30px;
    box-sizing: border-box;
  }
  .cell.year,
  .cell.month {
    border-right: none;
    border-left: none;
  }
  .cell.day {
    border-right: 1px solid #eee;
    background: #fafafa;
  }
  .right-border {
    border-right: 1px solid #eee !important;
  }
  
  .row {
    display: flex;
    align-items: center;
    height: auto;
    min-height: 28px;
    position: relative;
    align-items: stretch;
  }
  .bar-grid-wrapper {
    position: relative;
    flex-grow: 1;
    height: 28px;
    z-index: 0;
    transform: translateZ(0);
  }
  .grid-line {
    position: absolute;
    top: -1px;
    bottom: -1px;
    width: 1px;
    background: #eee;
    pointer-events: none;
    z-index: 0;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    contain: strict;
  }
  .bar-grid {
    display: grid;
    grid-template-columns: inherit;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-top: 4px;
  }
  .task-bar {
    background: linear-gradient(135deg, #a39fc8, #93a2c6, #83a5c3);
    color: #fff;
    font-size: 0.75rem;
    text-align: left;
    padding: 0 4px;
    border-radius: 4px;
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
  }
  .task-bar.completed-bar {
    background: #bbb !important;
    color: #fff;
  }
  .left-col.category {
    font-weight: bold;
    background: #ebecf1;
  }
  .left-col.subquest {
    color: #97a1c7;
  }
  .left-col.task {
    padding-left: 1rem;
    color: #444;
    font-style: normal;
  }
  .tap-expand {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
  .tap-expand.expanded {
    white-space: normal;
    overflow: visible;
    background: #fff;
    z-index: 10;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    position: relative;
  }
  .weekly-header, .weekly-body {
    width: fit-content;
  }
  
  
  .today-column {
    background-color: #fff7d6!important;
  }
  .cell.day.sunday {
    background-color: #ffeaea;
  }
  .cell.day.saturday {
    background-color: #eaf2ff;
  }
  .saturday-border {
    border-right: 2px solid #ddd !important;
    margin-left: -1px;
  }
  .weekly-header .cell.year.saturday-border,
  .weekly-header .cell.month.saturday-border {
    border-right: none !important;
  }
  .grid-line.saturday-border {
    width: 2px;
    background: #ddd;
  }
  
  
  
  .display-fc {
    position: relative;
  }
  .filter-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
    position: absolute;
    right: 0;
    top: 0;
    margin: 0.5rem 0;
  }
  .filter-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    margin: 0;
  }
  .filter-select {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='%2397a1c7' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 12l-5-5h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 1rem;
    padding-right: 2rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 7rem;
    margin: 0;
  }
  .filter-select:focus {
    border-color: #97a1c7;
    box-shadow: 0 0 0 2px rgba(151, 161, 199, 0.3);
    outline: none;
  }
  
  
  
  
  
  .task-control-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
  }
  .task-complete-checkbox {
    width: 22px;
    height: 22px;
    border: 1px solid #aaa;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    background: #f9f9f9;
  }
  .task-complete-checkbox input[type="checkbox"] {
    transform: scale(1.2);
  }
  
  
  
  
  
  .task-complete-checkbox {
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid #ccc;
    background: #f4f4f4;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    padding: 0;
    position: relative;
    transition: border-color 0.2s ease;
  }
  
  .task-complete-checkbox input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
  }
  
  .task-complete-checkbox .checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }
  
  .task-complete-checkbox svg {
    color: #ccc;
    transition: color 0.2s ease;
  }
  
  .task-complete-checkbox.checked svg {
    color: #fff;
  }
  
  .task-complete-checkbox.checked {
    border-color: #888;
    background: #97a1c7;
  }
  
  .task-complete-checkbox.checked .checkmark {
    color: #fff;
    display: flex;
  }
  
  .quest-composite-box.completed {
    background-color: #ddd;
    transition: background-color 0.3s ease;
  }

  .timeline-item.subquest-block.completed {
    background-color: #ddd !important;
  }
  .timeline-item.subquest-block.completed .timeline-top {
    color: #555;
  }
  
  
  .left-col.task.completed-task {
    color: #ccc;
  }




    /* ホーム */
    .step-guide {
        display: flex;
        flex-direction: column;
        gap: 1.5em;
        max-width: 600px;
        margin: auto;
        margin-top: 2em;
      }
      .step {
        display: flex;
        align-items: flex-start;
        gap: 1.5em;
        background: #f9f9fb;
        /* border-left: 6px solid #93a2c6; */
        padding: 1em;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
      }
      .step-number {
        font-weight: bold;
        font-size: 2em;
        color: #93a2c6;
        writing-mode: vertical-rl;
        line-height: 1;
      }
      .step-content h3 {
        margin: 0 0 0.4em;
        font-size: 1.5em;
        text-align: left;
        font-family: "游明朝", YuMincho, "Hiragino Mincho ProN W3", "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", "HG明朝E", "ＭＳ Ｐ明朝", "ＭＳ 明朝", serif;
      }
      .step-content p {
        margin: 0 0 0.8em;
        font-size: 0.95em;
      }
      .step-btn {
        display: inline-block;
        padding: 0.4em 1em;
        background: #93a2c6;
        color: white;
        border-radius: 5px;
        text-decoration: none;
        font-size: 0.9em;
        transition: background 0.3s;
        margin-bottom: 0.5rem;
      }
      .step-btn:hover {
        background: #7c8bb0;
      }
      .step-img {
        width: 100%;
      }
      #statusTrendChart {
          border-radius: 10px;
          padding: 0.5rem;
          background: rgba(255,255,255,0.05);
          margin-top: 1rem;
      }



      .progress-chart-group {
        display: flex;
        justify-content: space-around;
        gap: 0;
        flex-wrap: wrap;
    }
    .progress-chart {
        border-radius: 10px;
        flex: 1 1 30%;
        text-align: center;
        width:100%;
    }
    canvas {
        width: 100% !important;
        height: auto !important;
    }
    .homechart {
      background: linear-gradient(135deg, #a39fc8, #93a2c6, #83a5c3);
      margin-bottom: 0.5rem;
      margin-top: 1rem;
    }
    .homechart h3 {
      color: #fff;
      margin-top: 0;
    }


    .big-button-group {
      display: flex;
      gap: 10px;
      justify-content: center;
      margin: 1rem auto;
      max-width: 600px;
    }

    .big-action-button {
      flex: 1 1 0%;
      text-align: center;
      flex-direction: column;
      align-items: center;
      flex:1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      background:#fff;
      color:#7984af;
      padding: 0.5rem;
      font-size:0.85rem;
      font-weight:bold;
      border-radius:8px;
      text-decoration:none;
      transition: all 0.2s ease;
      border: 1px solid #97a1c7;
      box-shadow: 0 5px 10px rgba(0,0,0,0.05);
    }



      .words-box {
        max-width: 600px;
        margin: 2rem auto;
        padding: 1.5rem;
        text-align: center;
        margin-bottom: 0;
      }
      .words-main {
        font-size: 1rem;
        margin-bottom: 0.5rem;
      }
      .words-sub {
        font-size: 0.9rem;
        color: #777;
        text-align: center;
      }






.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.4s ease forwards; /* ←オーバーレイにフェードイン */
}

.popup-content2 {
    background: #000;
    padding: 5px;
    width: 400px;
    max-width: 80%;
    text-align: center;
    color: #fff;
    font-size: 1rem;
    border-radius: 5px;
    position: relative;
    font-family: 'DotGothic16', sans-serif;
    opacity: 0;
    transform: scale(1.1); /* 最初少し拡大 */
    animation: popupAppear 0.5s ease forwards;
    animation-delay: 0.2s; /* オーバーレイの後に遅れて発動 */
}

.popup-inner {
    padding: 2rem;
    border: 2px solid #fff;
    border-radius: 4px;
}
.popup-buttons {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
}
.popup-button {
    display: inline-block;
    width: 12rem;
    padding: 0.5rem 0;
    background: #fff;
    color: #000;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.popup-button:hover {
    background: #eee;
}
.popup-button.close {
    opacity: 0.8;
}

/* ===== アニメーション定義 ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes popupAppear {
    0% {
        opacity: 0;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}



.setyear {
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #444;
  font-size: 0.9rem;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 5rem;
  margin: 0.5rem 0;
}



.eng-info .note {
  color: #fff;
  opacity: 0.6;
  margin: 0.5rem;
}
.eng-info h3 {
  margin-bottom: 0.5rem;
}
.eng-info h4 {
  color: #fff;
  opacity: 0.7;
}
.border-b {
  border-bottom: 1px solid #fff;
  opacity: 0.25;
  margin: 2rem 0 1rem 0;
}


.accent-button, .chat-message button {
  background: linear-gradient(to right,rgba(248,166,127,1),rgba(244,159,190,1));
  color: #fff;
  border: 1px solid #f5a2a3;
  font-weight: 600;
}
.accent-button:hover, .chat-message button:hover {
  background: linear-gradient(to right,rgba(248,166,127,0.7),rgba(244,159,190,0.7));
  border: 1px solid #f5a2a3;
}
.accent-button svg {
  fill: #fff;
}



.chat-message input {
  border: 0;
}
.chat-message select {
  height: 2.5rem;
  color: #7984af;
  border: 0;
}