@charset "UTF-8";
.swiper {
  width: 550px;
  z-index: 0;
}

.swiper .img-box {
  width: 100% !important;
}

.swiper.thumb-swiper {
  margin-top: 20px;
}

.swiper.thumb-swiper .swiper-slide {
  cursor: pointer;
  transition: var(--rp-transition);
  opacity: 0.6;
}

.swiper.thumb-swiper .swiper-slide:hover {
  opacity: 0.8;
}

.swiper.thumb-swiper .swiper-slide.swiper-slide-thumb-active {
  opacity: 1;
}

.download-all-container {
  width: 100%;
}

.download-all-container .btn {
  display: inline-flex;
  background-color: var(--rp-primary);
}

@media screen and (max-width: 767px) {
  .swiper {
    width: 100%;
  }
}
#mKeyword,
#sKeyword {
  width: 70%;
}

.prompt-area .select-category-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}


.prompt-area .select-category-list li input[type=radio] {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  z-index: -1;
}

.prompt-area .select-category-list li label {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: var(--rp-radius-sm);
  background-color: var(--rp-border-strong);
  font-size: 0.875rem;
  font-weight: var(--fw-500);
  text-align: center;
  transition: var(--rp-transition);
}

.prompt-area .select-category-list li input[type=radio]:checked + label {
  background-color: var(--rp-primary);
}

main.sub-content .prompt-area form .order fieldset .select-category-list li.input-box {
  width: 100%;
  background-color: var(--rp-border-strong);
}

.prompt-area .select-writer-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px 10px;
}

.prompt-area .select-writer-list li {
  width: calc((100% - 20px) / 3);
  position: relative;
  overflow: hidden;
}

/* .prompt-area .select-category-list li:last-child {
	width: auto;
} */
.prompt-area .select-writer-list input[type=radio] {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  opacity: 0;
  z-index: -1;
}

.prompt-area .select-writer-list label {
  cursor: pointer;
}

.prompt-area .select-writer-list label .thumb {
  display: block;
  align-items: center;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  border-radius: var(--rp-radius-sm);
  background-color: var(--rp-border-strong);
}

.prompt-area .select-writer-list label .thumb::before {
  content: "";
  width: 102%;
  height: 102%;
  border-radius: var(--rp-radius-sm);
  border-left: 3px solid var(--rp-primary);
  border-right: 3px solid var(--rp-gradient-end);
  background-image: linear-gradient(to left, var(--rp-primary), var(--rp-gradient-end)), linear-gradient(to left, var(--rp-primary), var(--rp-gradient-end));
  background-size: 100% 3px;
  background-position: 0 100%, 0 0;
  background-repeat: no-repeat;
  background-clip: padding-box;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: var(--rp-transition);
  z-index: 3;
}

.prompt-area .select-writer-list label:hover .thumb::before {
  opacity: 0.5;
}

.prompt-area .select-writer-list label .thumb i,
.prompt-area .select-writer-list label .thumb img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.prompt-area .select-writer-list li:nth-child(4) label .thumb img,
.prompt-area .select-writer-list li:nth-child(5) label .thumb img {
  width: 120%;
  top: 65%;
}

.prompt-area .select-writer-list li:nth-child(6) label .thumb img {
  width: 110%;
}

.prompt-area .select-writer-list label .thumb i {
  font-size: 1.875rem;
  opacity: 0.5;
}

.prompt-area .select-writer-list label .thumb img {
  width: 150%;
  max-width: 150%;
}

.prompt-area .select-writer-list label em {
  display: block;
  text-align: center;
  font-style: normal;
  margin-top: 10px;
  font-size: 0.9375rem;
  font-weight: var(--fw-500);
}

.prompt-area .select-writer-list input[type=radio]:checked + label .thumb::before {
  opacity: 1;
}

.result-img {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.result-img .img-box {
  width: 600px;
  position: relative;
  display: flex;
  justify-content: center;
}

.result-img .img-box figure,
.swiper .img-box figure {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  overflow: hidden;
  position: relative;
}

.result-img .img-box figure img,
.swiper .img-box figure img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  border-radius: 3%;
}

.result-img .img-box .tool-list,
.swiper .img-box .tool-list {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 30px;
  padding: 30px 20px;
}

#premium .thumb-swiper .tool-list {
  display: none !important;
}

.result-img .img-box .tool-list::before,
.swiper .img-box .tool-list::before {
  content: "";
  width: 100%;
  height: 90px;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--rp-chrome) 90%, transparent));
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: -1;
}

.result-img .img-box .tool-list .tool,
.swiper .img-box .tool-list .tool {
  position: relative;
  opacity: 0.5;
  transition: var(--rp-transition);
}

.result-img .img-box .tool-list .tool:hover,
.swiper .img-box .tool-list .tool:hover {
  opacity: 1;
}

.result-img .img-box .tool-list .tool .button,
.swiper .img-box .tool-list .tool .button {
  cursor: pointer;
}

.result-img .img-box .tool-list .tool .button i,
.swiper .img-box .tool-list .tool .button i {
  font-size: 1.375rem;
}

.result-img .img-box .tool-list .tool .tooltip,
.swiper .img-box .tool-list .tool .tooltip {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  font-size: 0.875rem;
  font-weight: var(--fw-500);
  background-color: color-mix(in srgb, var(--rp-chrome) 60%, transparent);
  border-radius: var(--rp-radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: var(--rp-transition);
  text-align: center;
  padding: 2px 5px;
}

.result-img .img-box .tool-list .tool:hover .tooltip,
.swiper .img-box .tool-list .tool:hover .tooltip {
  opacity: 1;
  top: -25px;
}

.result-img .img-box .tool-list .tool .tooltip::before,
.swiper .img-box .tool-list .tool .tooltip::before {
  content: "";
  width: 10px;
  height: 0;
  border-top: 6px solid color-mix(in srgb, var(--rp-chrome) 60%, transparent);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
}

@media screen and (max-width: 767px) {
  .prompt-area .select-writer-list {
    gap: 10px 5px;
  }
  .prompt-area .select-writer-list li {
    width: calc((100% - 10px) / 3);
  }
  .prompt-area .select-writer-list label .thumb i {
    font-size: 1.5625rem;
  }
  .prompt-area .select-writer-list label em {
    font-size: 0.8125rem;
    margin-top: 7px;
  }
}
@media screen and (max-width: 460px) {
  .result-img .img-box .tool-list,
  .swiper .img-box .tool-list {
    padding: 20px;
  }
  .result-img .img-box .tool-list .tool .button i,
  .swiper .img-box .tool-list .tool .button i {
    font-size: 1.25rem;
  }
  .result-img .img-box .tool-list .tool .tooltip,
  .swiper .img-box .tool-list .tool .tooltip {
    font-size: 0.8125rem;
    width: 55px;
  }
}
.prompt-area form .submit {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px 5px;
  flex-wrap: wrap;
  padding-left: 0;
  padding-right: 0;
}

.prompt-area form .submit.on {
  width: calc(100% - 5px) !important;
}

.prompt-area form .submit.on .premium-box {
  display: none !important;
}

/*.success .prompt-area form .submit .btn-submit,*/
/*.success .prompt-area form .submit .premium-box,*/
/*.running .prompt-area form .submit .btn-submit,*/
/*.running .prompt-area form .submit .premium-box,*/
.result .prompt-area form .submit .btn-submit,
.result .prompt-area form .submit .premium-box {
  width: calc((100% - 5px) / 2) !important;
}

.prompt-area form .submit .premium-box {
  position: relative;
  z-index: 2;
  /* margin-top: 10px; */
}

.prompt-area form .submit .premium-box .btn-premium {
  width: 100%;
  justify-content: center;
  background: linear-gradient(to right, #d8be6c, #b39150);
  font-size: 0.9375rem;
}

.prompt-area form .submit .premium-box .btn-premium.init-premium {
  display: none;
}

.prompt-area form .submit .premium-box .btn-premium span {
  font-size: inherit;
}

.prompt-area form .submit .premium-box .tooltip {
  position: absolute;
  background-color: color-mix(in srgb, var(--rp-chrome) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  padding: 4px 7px;
  border-radius: var(--rp-radius-sm);
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  text-align: center;
  font-weight: var(--fw-500);
  pointer-events: none;
  opacity: 0;
  transition: var(--rp-transition);
}

.prompt-area form .submit .premium-box:hover .tooltip {
  opacity: 1;
}

.prompt-area form .submit .premium-box .tooltip::after {
  content: "";
  width: 10px;
  height: 0;
  border-top: 6px solid color-mix(in srgb, var(--rp-chrome) 70%, transparent);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
}

.prompt-area form .submit .btn-reset {
  width: 100%;
  justify-content: center;
  background-color: var(--rp-border-strong);
}

.success .result-area .response {
  box-sizing: border-box;
  padding: 20px;
  border-radius: var(--rp-radius-sm);
  background-color: var(--rp-surface);
  border: 1px solid var(--rp-border);
  color: var(--rp-text);
  box-shadow: var(--rp-shadow-sm);
}

.result-area .response .tool-box {
  margin-bottom: 15px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--rp-border);
  justify-content: space-between;
}

.result-area .response .tool-box > span {
  display: inline-block;
  font-size: 0.875rem;
  background-color: var(--rp-gradient-end);
  padding: 5px 10px;
  border-radius: var(--rp-radius-sm);
}

#response .tool-box > span {
  background: linear-gradient(to top, var(--rp-primary), var(--rp-gradient-end));
}

#premium .tool-box > span {
  background: linear-gradient(to right, #d8be6c, #b39150);
}

.result-area .response .tool-box button {
  background-color: var(--rp-border-strong);
  font-size: 0.9375rem;
}

.result-area .response .tool-box button * {
  font-size: inherit;
}

.before-after li {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.before-after li:not(:first-child) {
  margin-top: 30px;
}

.before-after li figure {
  display: block;
  width: 300px;
  height: 0;
  padding-bottom: 50%;
  border-radius: var(--rp-radius);
  overflow: hidden;
  position: relative;
}

.before-after li figure img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.before-after li i {
  font-size: 40px;
  color: var(--rp-primary);
}

@media screen and (max-width: 767px) {
  .before-after li figure {
    width: 250px;
  }
}
@media screen and (max-width: 640px) {
  .before-after li figure {
    width: 200px;
  }
}
@media screen and (max-width: 460px) {
  .before-after li {
    gap: 5px;
  }
  .before-after li figure {
    width: 150px;
  }
  .before-after li i {
    font-size: 30px;
  }
}
/* 프리미엄 원고 기능 추가에 따른 스타일 추가 */
main.success:not(.success.result) .result-area,
main.sub-content .result-area.premium,
main.sub-content .result-area.premium-active,
main.success.plus .result-area {
  gap: 20px;
  flex-wrap: wrap;
}

main.success:not(.success.result) .result-area > div,
main.sub-content .result-area.premium > div,
main.sub-content .result-area.premium-active > div,
main.success.plus .result-area > div {
  width: calc((100% - 20px) / 2);
  line-height: 1.5;
  font-weight: 300;
}

#content-body {
  line-height: 1.5;
  font-weight: 300;
}

main.sub-content .prompt-area form .order fieldset .input-box textarea {
  line-height: 1.5;
}

@media screen and (max-width: 1100px) {
  main.success:not(.success.result) .result-area,
  main.sub-content .result-area.premium,
  main.sub-content .result-area.premium-active {
    flex-direction: row-reverse;
  }
  main.success:not(.success.result) .result-area > div,
  main.sub-content .result-area.premium > div,
  main.sub-content .result-area.premium-active > div, main.success.plus .result-area > div {
    width: 100%;
  }
}
@media screen and (max-width: 900px) {
  .prompt-area form .submit .premium-box .btn-premium {
    font-size: 14px;
  }
}
@media screen and (max-width: 767px) {
  .prompt-area form .submit .premium-box .btn-premium {
    font-size: 13px;
  }
  .result-area .response .tool-box > span {
    font-size: 11px;
  }
  .result-area .response .tool-box button {
    font-size: 12px;
  }
}
/* 코치마크 추가 - 250520 */
.driver-active-element {
  border: 3px solid var(--rp-primary);
}

.driver-fade .driver-overlay path {
  opacity: 0.75 !important;
}

.driver-popover *:not(i) {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  word-break: keep-all;
}

.driver-popover i {
  color: inherit;
  font-size: inherit;
}

.driver-popover-title {
  color: var(--rp-primary);
}

.driver-popover-description {
  color: var(--rp-text-muted);
  white-space: pre-line;
}

.driver-popover-description small {
  font-size: 12px;
  opacity: 0.8;
  display: inline-block;
  color: inherit;
}

.driver-popover-description span {
  color: inherit;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  padding: 3px;
  border-radius: var(--rp-radius-sm);
  background-color: var(--rp-surface-alt);
  margin-top: 5px;
}

.driver-popover-description span em {
  background-color: var(--rp-gradient-end);
  padding: 2px;
  border-radius: var(--rp-radius-sm);
  font-size: 12px;
  font-style: normal;
}

.driver-popover-footer button {
  background-color: var(--rp-surface-hover);
  text-shadow: none;
  border: none;
  transition: var(--rp-transition);
  color: var(--rp-text-muted);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
}

@media screen and (max-width: 900px) {
  .driver-popover-title {
    font-size: 18px;
  }
}
@media screen and (max-width: 767px) {
  .driver-popover-title {
    font-size: 16px;
  }
  .driver-popover-description {
    font-size: 13px;
    margin-top: 2px;
  }
  .driver-popover-progress-text {
    font-size: 12px;
  }
  .driver-popover-footer {
    margin-top: 10px;
  }
}
/* 250522 스타일 추가 */

#premium .images-container .images-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

#premium .images-container .images-header button {
  background: linear-gradient(to bottom, var(--rp-primary), var(--rp-gradient-end));
  width: 100%;
  justify-content: center;
}

#premium .swiper {
  width: 100%;
}


.prompt-area .select-category-list.col-4 li {
  width: calc((100% - 30px) / 4);
}

.prompt-area .select-category-list.col-2 li {
  width: calc((100% - 10px) / 2);
}

.prompt-area .select-category-list.col-1 li {
  width: 100%;
}

main.success:not(.success.result) .result-area > #response,
main.sub-content.running.success .result-area > #response,
#response {
  width: 25%;
  text-align: center;
  align-items: center;
}

main.sub-content.running .result-area > #response {
  width: 100%;
}

main.sub-content.running .result-area > #premium {
  width: 0%;
}

main.success:not(.success.result) .result-area > #premium,
main.sub-content.running.success .result-area > #premium,
#premium {
  width: calc(100% - 20px - 25%);
}

#premium .swiper-wrapper {
  height: auto;
}

.prompt-area .select-category-list li {
  position: relative;
  overflow: hidden;
  width: auto;
}

.thumb-swiper .img-box figure {
  padding-bottom: 50%;
}

.thumb-swiper .img-box figure img {
  max-height: 1500%;
}

#keyword-loading-message {
  margin-top: 30px;
  text-align: center;
}

#keyword-loading-message em {
  font-style: normal;
  display: inline-block;
  font-size: 0.9375rem;
}

#keyword-loading-message i {
  display: inline-block;
  background: linear-gradient(to bottom, var(--rp-primary), var(--rp-gradient-end));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: inherit;
}

#keyword-loading-message span {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.9375rem;
  opacity: 0.7;
}

#premium .images-container {
  width: 100%;
  margin-top: 0 !important;
  display: flex;
  gap: 20px;
  height: calc(100% - 60px) !important;
}

#premium .main-swiper {
  margin-top: 0;
  width: calc(75% - 20px) !important;
}

.main-swiper .img-box figure {
  padding-bottom: 85%;
}

#premium .thumb-swiper {
  width: 25% !important;
  height: 100% !important;
}

@media screen and (max-width: 1200px) {
  main.success:not(.success.result) .result-area > #response, main.sub-content.running.success .result-area > #response, #response {
    width: 35%;
  }
  main.success:not(.success.result) .result-area > #premium, main.sub-content.running.success .result-area > #premium, #premium {
    width: calc(100% - 20px - 35%);
  }
  .main-swiper .img-box figure {
    padding-bottom: 65%;
  }
}
@media screen and (max-width: 1100px) {
  main.success:not(.success.result) .result-area, main.sub-content .result-area.premium, main.sub-content .result-area.premium-active {
    flex-direction: row;
  }
}
@media screen and (max-width: 767px) {
  main.success:not(.success.result) .result-area > #response, main.sub-content.running.success .result-area > #response, #response,
  main.success:not(.success.result) .result-area > #premium, main.sub-content.running.success .result-area > #premium, #premium {
    width: 100%;
  }
  main.success:not(.success.result) .result-area > #premium, main.sub-content.running.success .result-area > #premium, #premium {
    height: auto;
  }
  .main-swiper .img-box figure {
    padding-bottom: 100%;
  }
  .thumb-swiper .img-box figure {
    padding-bottom: 80%;
  }
  .swiper-button-next:after, .swiper-button-prev {
    left: 0;
  }
  .swiper-button-next:after, .swiper-button-next {
    right: 0;
  }
  .swiper-button-next:after, .swiper-button-prev:after,
  .swiper-button-next:after, .swiper-button-next:after {
    font-size: 1.25rem;
  }
}
#fs_format {
  padding-bottom: 15px;
}

/* 업체명 입력 관련 스타일 */
.add-company-button-container {
  margin-bottom: 15px;
}

.company-name-item {
  margin-bottom: 15px;
}

.company-name-item .input-box {
  position: relative;
}

.btn-delete-company {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--rp-danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  z-index: 10;
}

.btn-delete-company:hover {
  background: var(--rp-danger);
  transform: scale(1.1);
}

.company-name-item input {
  padding-right: 40px; /* 삭제 버튼 공간 확보 */
}

#add-company-btn, #add-region-btn {
  background: var(--rp-primary);
  color: var(--rp-text-muted);
  transition: all 0.2s ease;
}

#add-company-btn:hover, #add-region-btn:hover {
  background: var(--rp-danger);
  color: var(--rp-text);
}

/* 참고 블로그 URL 입력 관련 스타일 */
.add-reference-blog-button-container {
  margin-bottom: 15px;
}

.reference-blog-url-item {
  margin-bottom: 15px;
}

.reference-blog-url-item .input-box {
  position: relative;
}

.btn-delete-reference-blog {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--rp-danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  z-index: 10;
}

.btn-delete-reference-blog:hover {
  background: var(--rp-danger);
  transform: scale(1.1);
}

.reference-blog-url-item input {
  padding-right: 40px; /* 삭제 버튼 공간 확보 */
}

#add-reference-blog-btn {
  background: #3498db;
  color: white;
  transition: all 0.2s ease;
}

#add-reference-blog-btn:hover {
  background: #2980b9;
  opacity: 0.9;
}

/* 키워드 입력 영역 스타일 */
#keyword {
  display: flex;
  flex-direction: column;
}

#keyword legend {
  margin-bottom: 10px;
}

.keyword-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.input-box.input-with-button {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.input-box.input-with-button input {
  flex: 1;
  min-width: 220px;
}

.autocomplete-btn {
  background: var(--rp-accent);
  color: var(--rp-chrome-title);
  border: none;
  padding: 8px 14px;
  border-radius: var(--rp-radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.autocomplete-btn.is-loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.autocomplete-btn i {
  font-size: 0.8rem;
}

.autocomplete-btn:hover {
  opacity: 0.9;
}

body.modal-open {
  overflow: hidden;
}

#autocomplete-modal {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--rp-chrome) 55%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#autocomplete-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.autocomplete-modal-content {
  background: var(--rp-surface);
  border-radius: var(--rp-radius);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--rp-shadow-lg);
  display: flex;
  flex-direction: column;
}

.autocomplete-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rp-border);
}

.autocomplete-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.autocomplete-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--rp-text-muted);
}

.autocomplete-modal-body {
  padding: 20px 22px 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.autocomplete-status {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--rp-text);
}

.autocomplete-loading {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--rp-accent);
}

.autocomplete-loading.show {
  display: flex;
}

.autocomplete-error {
  color: var(--rp-danger);
  font-size: 0.9rem;
  margin-bottom: 12px;
  display: none;
}

.autocomplete-error.show {
  display: block;
}

#autocomplete-results {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#autocomplete-results li {
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s ease, border 0.15s ease;
}

#autocomplete-results li:hover {
  background: var(--rp-surface-hover);
  border-color: var(--rp-border-strong);
}

.autocomplete-suggestion-main {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--rp-text);
}

.autocomplete-suggestion-main.same-as-main {
  color: var(--rp-text-muted);
  font-weight: 500;
}

.autocomplete-suggestion-sub {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rp-text);
  margin-top: 4px;
}

/* 키워드 입력 버튼 스타일 */
#add-mKeyword, #add-mKeyword-manual, #add-mKeyword-auto, #add-mKeyword-ai {
  background-color: var(--rp-primary);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: var(--rp-radius-sm);
  font-size: 0.75rem;
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

#add-mKeyword:hover, #add-mKeyword-manual:hover, #add-mKeyword-auto:hover, #add-mKeyword-ai:hover {
  opacity: 0.8;
}

.ai-app {
  width: 100%;
  min-width: 0;
  padding: clamp(18px, 3vw, 36px);
  box-sizing: border-box;
}

.ai-app__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.ai-app__eyebrow {
  margin: 0 0 6px;
  color: var(--rp-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.ai-app__header h1 {
  margin: 0;
  color: var(--rp-text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.ai-app__description {
  margin: 0;
  color: var(--rp-text-muted);
  font-size: 14px;
}

.ai-app__switch {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm);
  color: var(--rp-text-muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  background: var(--rp-surface-alt);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ai-app__switch:hover {
  color: var(--rp-chrome-title);
  border-color: var(--rp-primary);
  background: var(--rp-primary-soft);
}

.ai-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.ai-sections__item {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  color: var(--rp-text-muted);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  background: var(--rp-surface);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ai-sections__item:hover,
.ai-sections__item.is-active {
  color: var(--rp-chrome-title);
  border-color: var(--rp-primary);
  background: var(--rp-primary-soft);
}

.ai-tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  background: var(--rp-surface-alt);
}

/* 탭 개수에 따라 열 수 분리 (글쓰기 3 / 이미지 4) */
.ai-tabs:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ai-tabs:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ai-tabs:has(> :nth-child(5):last-child) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
/* :has 미지원·개수 미확정 시 기본 */
@supports not selector(:has(*)) {
  .ai-tabs {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}

.ai-tabs[hidden] {
  display: none;
}

.ai-tabs__item {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: var(--rp-radius-sm);
  color: var(--rp-text-muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.ai-tabs__item:hover {
  color: var(--rp-chrome-title);
  background: var(--rp-surface-hover);
  transform: translateY(-1px);
}

.ai-tabs__item.is-active {
  color: var(--rp-chrome-title);
  background: linear-gradient(135deg, var(--rp-primary), var(--rp-gradient-end));
  box-shadow: var(--rp-shadow);
}

.ai-tabs__item.is-legacy::after {
  content: "↗";
  margin-left: 1px;
  font-size: 10px;
  opacity: 0.55;
}

.ai-app__viewport {
  position: relative;
  min-height: 520px;
}

.ai-app__loading,
.ai-app__error {
  display: flex;
  min-height: 320px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--rp-border);
  border-radius: var(--rp-radius);
  color: var(--rp-text-muted);
  background: var(--rp-surface);
}

.ai-app__loading[hidden] {
  display: none;
}

.ai-app__view {
  min-width: 0;
}

.ai-app__view > main.sub-content {
  width: 100%;
  max-width: none;
}

@media (max-width: 960px) {
  /* 961+ 와 동일하게 헤더 가로 유지 — usage-strip이 아래로 떨어지지 않게 */
  .ai-app__header {
    align-items: flex-end;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
  }
  .ai-app__header .ai-usage-strip {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
  }
  .ai-tabs {
    display: flex;
  }
  .ai-tabs__item {
    min-width: 128px;
  }
}
@media (max-width: 600px) {
  .ai-app {
    padding: 14px 10px 24px;
  }
  .ai-app__description {
    font-size: 12px;
  }
  .ai-sections__item {
    min-height: 46px;
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* ============================================================
   AI 글쓰기 공통 스타일 (구 features/ai/writing/style.css)
   - rp-tokens.css 의 CSS 변수 사용 → 라이트·다크 모드 자동 대응
   ============================================================ */

/* 1. 이용 현황 배너 (.ai-usage-strip)
      글쓰기·이미지 생성 공용 */

.ai-usage-strip {
    display: flex;
    align-items: stretch;
    gap: 14px;
    margin: 0 30px 18px;
    padding: 14px;
    border-radius: var(--rp-radius, 14px);
    overflow: hidden;
    background: linear-gradient(155deg, var(--rp-surface) 0%, var(--rp-surface-alt) 100%);
    border: 1px solid var(--rp-border);
    box-shadow: var(--rp-shadow), inset 0 1px 0 var(--rp-surface-hover);
}

.ai-app__header .ai-usage-strip {
    margin: 0;
    flex: 1 1 280px;
    max-width: 560px;
    min-width: 0;
}
.ai-usage-strip--ok {
    box-shadow:
        var(--rp-shadow),
        inset 0 1px 0 var(--rp-surface-hover),
        inset 3px 0 0 color-mix(in srgb, var(--rp-success-bright) 75%, transparent);
}
.ai-usage-strip--warn {
    background: linear-gradient(
        155deg,
        color-mix(in srgb, var(--rp-warning) 12%, var(--rp-surface)) 0%,
        var(--rp-surface-alt)                                          100%
    );
    border-color: var(--rp-warning-border);
    box-shadow:
        var(--rp-shadow),
        inset 0 1px 0 var(--rp-surface-hover),
        inset 3px 0 0 color-mix(in srgb, var(--rp-warning) 85%, transparent);
}

.ai-usage-strip__badge {
    flex-shrink: 0;
    width: 44px;
    min-height: 44px;
    border-radius: var(--rp-radius-medium, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--rp-surface-alt);
    border: 1px solid var(--rp-border);
    color: var(--rp-text-muted);
}
.ai-usage-strip--ok .ai-usage-strip__badge {
    color: var(--rp-success-bright-text);
    background: var(--rp-success-bright-soft);
    border-color: color-mix(in srgb, var(--rp-success-bright) 20%, transparent);
}
.ai-usage-strip--warn .ai-usage-strip__badge {
    color: var(--rp-warning);
    background: color-mix(in srgb, var(--rp-warning) 10%, transparent);
    border-color: color-mix(in srgb, var(--rp-warning) 22%, transparent);
}

.ai-usage-strip__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.ai-usage-strip__title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rp-text-muted);
}
.ai-usage-strip--warn .ai-usage-strip__title {
    color: color-mix(in srgb, var(--rp-warning) 55%, var(--rp-text-muted));
}

.ai-usage-bar__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 500;
    color: var(--rp-text);
}
.ai-usage-strip--warn .ai-usage-bar__text {
    color: var(--rp-text-subtle);
}

.ai-usage-bar__ok  { color: var(--rp-success-bright-text); font-weight: 700; }
.ai-usage-bar__sub { color: var(--rp-warning); font-weight: 700; }
.ai-usage-strip__sep { opacity: 0.45; }

/* 링크 — ok / warn 두 상태 모두 */
.ai-usage-strip a {
    color: var(--rp-link);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--rp-link) 40%, transparent);
    transition: color var(--rp-transition), border-color var(--rp-transition);
}
.ai-usage-strip a:hover {
    color: color-mix(in srgb, var(--rp-link) 80%, var(--rp-on-brand));
    border-bottom-color: var(--rp-link);
}
.ai-usage-strip--warn a {
    color: var(--rp-warning);
    border-bottom-color: color-mix(in srgb, var(--rp-warning) 45%, transparent);
}
.ai-usage-strip--warn a:hover {
    color: color-mix(in srgb, var(--rp-warning) 80%, white);
    border-bottom-color: color-mix(in srgb, var(--rp-warning) 80%, white);
}

/* 2. AI 글쓰기 페이지 공통 레이아웃
      .homepad-page / .affiliate-page / .shortent-page */

/* 2-1. 메인 래퍼 */
.homepad-page,
.affiliate-page,
.shortent-page {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex-wrap: wrap;
    min-height: 0;
}

/* 2-2. 프롬프트(입력) 패널 */
.homepad-page  > .prompt-area,
.affiliate-page > .prompt-area,
.shortent-page  > .prompt-area {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
}

/* 2-3. 폼 */
.homepad-page  > .prompt-area > form,
.affiliate-page > .prompt-area > form,
.shortent-page  > .prompt-area > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

/* 2-4. .order (필드셋 묶음) */
.homepad-page  .order,
.affiliate-page .prompt-area form .order,
.shortent-page  .prompt-area form .order {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* 2-5. .submit (하단 버튼 영역) */
.homepad-page  .submit,
.affiliate-page .prompt-area form .submit,
.shortent-page  .prompt-area form .submit {
    margin-top: auto;
    padding-left: 0  !important;
    padding-right: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

/* 2-6. 결과 패널 공통 */
.homepad-page  > .result-area,
.affiliate-page > .result-area,
.shortent-page  > .result-area {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    align-self: stretch;
}

/* 2-7. 제휴·숏텐츠 결과 영역 (2열 flex-wrap) */
.affiliate-page .result-area,
.shortent-page  .result-area {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: stretch;
    gap: clamp(16px, 2.5vw, 28px);
    width: 100%;
    max-width: min(1480px, 100%);
    margin-left: auto;
    margin-right: auto;
    padding-left:  clamp(8px, 1.5vw, 20px);
    padding-right: clamp(8px, 1.5vw, 20px);
    box-sizing: border-box;
    min-width: 0;
}

/* 2-8. 결과 텍스트 박스 (overflow 스크롤) — idle 제외 */
.affiliate-page .result-area:not(.affiliate-result-area--idle) #response.result-txt,
.shortent-page  .result-area:not(.shortent-result-area--idle) #response.response.result-txt {
    position: relative;
    flex: 1 1 100%;
    min-width: 0;
    min-height: min(52vh, 560px);
    max-height: min(90vh, calc(100dvh - 56px));
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    box-sizing: border-box;
}

/* 2-9. 반응형 */
@media (max-width: 1024px) {
    .affiliate-page .result-area,
    .shortent-page  .result-area {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }
}
@media (max-width: 600px) {
    .affiliate-page .result-area,
    .shortent-page  .result-area {
        padding-left: 10px;
        padding-right: 10px;
        gap: 18px;
    }
}

/* 3. 카드 패널 베이스 (.ai-surface-card)
      homepad·affiliate·shortent 공용 — rp-tokens 의 surface 계열을
      그대로 써서 라이트/다크 모드에 맞춰 카드 배경이 자동으로 전환됨 */

.ai-surface-card {
    background: linear-gradient(155deg, var(--rp-surface) 0%, var(--rp-surface-alt) 100%);
    border: 1px solid var(--rp-border);
    box-shadow: var(--rp-shadow), inset 0 1px 0 var(--rp-surface-hover);
    border-radius: var(--rp-radius, 14px);
    overflow: hidden;
}

/* 4. select 공통 리셋 (입력 박스 안 select) */

.prompt-area form .order fieldset .input-box select,
.prompt-area .input-box select {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    line-height: inherit;
    cursor: pointer;
    outline: none;
}
.prompt-area form .order fieldset .input-box select:focus,
.prompt-area .input-box select:focus {
    outline: none;
}
.prompt-area form .order fieldset .input-box select option,
.prompt-area .input-box select option {
    color: var(--rp-text);
    background-color: var(--rp-surface);
}

/* 5. 알림 박스 공용 (.ai-notice) — reCAPTCHA 안내 / 검증 실패 메시지
      제휴마케팅·숏텐츠·홈판 공용. 색상은 전부 rp-tokens 라이트·다크 적응형. */

.ai-notice {
    margin: 0 0 15px;
    padding: 16px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--rp-warning) 14%, var(--rp-surface));
    border: 1px solid color-mix(in srgb, var(--rp-warning) 35%, transparent);
    box-shadow: var(--rp-shadow-sm);
    font-size: 14px;
    line-height: 1.6;
    color: var(--rp-text);
}
.ai-notice__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.ai-notice__head i { color: var(--rp-warning); font-size: 22px; flex-shrink: 0; }
.ai-notice__title { color: var(--rp-text); font-size: 15px; font-weight: 700; }
.ai-notice__body {
    color: var(--rp-text-subtle);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}
.ai-notice__body:empty { display: none; margin-bottom: 0; }
.ai-notice__widget { display: flex; justify-content: center; }
.ai-notice__countdown {
    margin-top: 10px;
    font-size: 12px;
    color: var(--rp-text-muted);
    display: none;
}
.ai-notice__countdown.is-visible { display: block; }
.ai-notice__success { color: var(--rp-success); font-weight: 700; }
.ai-notice__warn-text { color: var(--rp-warning); }
.ai-notice__danger-text { color: var(--rp-danger); }
.ai-notice__muted { color: var(--rp-text-muted); }

/* 검증 실패 등 위험 톤 알림 */
.ai-notice--danger {
    background: color-mix(in srgb, var(--rp-danger) 10%, var(--rp-surface));
    border-color: color-mix(in srgb, var(--rp-danger) 30%, transparent);
}
.ai-notice--danger .ai-notice__title { color: var(--rp-danger); }
.ai-notice__hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--rp-text-muted);
}

/* ============================================================
   6. AI 이미지 생성 공통 워크스페이스
      .ai-image-page (generate / edit / card)
      - rp-tokens 기반 라이트·다크 대응
      - 페이지별 전용 UI는 features/ai/image/*/style.css
   ============================================================ */

main.sub-content.ai-image-page {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 16px;
    color: var(--rp-text);
}

main.sub-content.ai-image-page > .prompt-area {
    position: relative !important;
    top: auto !important;
    align-self: stretch !important;
    width: 420px !important;
    max-width: 420px !important;
    flex: 0 0 420px !important;
    height: auto !important;
    min-height: min(72vh, 780px);
    max-height: calc(100dvh - 160px);
    margin: 0 !important;
    padding: 18px !important;
    box-sizing: border-box;
    z-index: 2;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    transition: width 0.25s ease, flex-basis 0.25s ease, padding 0.25s ease;
}

main.sub-content.ai-image-page > .prompt-area > form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
    overflow: hidden;
}

main.sub-content.ai-image-page .prompt-area form .order {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 !important;
    box-sizing: border-box;
    scrollbar-width: thin;
}

main.sub-content.ai-image-page .prompt-area form .order fieldset,
main.sub-content.ai-image-page .prompt-area form .order fieldset:not(:first-child) {
    margin: 0 0 12px !important;
    padding: 14px !important;
    border: 1px solid var(--rp-border) !important;
    border-radius: var(--rp-radius-medium, 8px) !important;
    background: var(--rp-surface-alt) !important;
    min-width: 0;
    box-sizing: border-box;
}

main.sub-content.ai-image-page .prompt-area form .order fieldset legend {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: calc(100% + 8px);
    max-width: calc(100% + 8px);
    margin: 0 0 0 -4px !important;
    padding: 0 4px 0 0 !important;
    float: none !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rp-text-muted) !important;
    line-height: 1.3;
}

main.sub-content.ai-image-page .prompt-area form .order fieldset .input-box {
    display: block !important;
    width: 100% !important;
    margin-top: 8px !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-sizing: border-box;
}

main.sub-content.ai-image-page .input-box.textarea-tall {
    height: 200px;
}

main.sub-content.ai-image-page .input-box.textarea-tall textarea,
main.sub-content.ai-image-page .input-box input[type="text"] {
    resize: none;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius-medium, 8px);
    background: var(--rp-surface);
    color: var(--rp-text);
    font-size: 14px;
    line-height: 1.55;
    outline: none;
    transition: border-color var(--rp-transition), box-shadow var(--rp-transition);
}

main.sub-content.ai-image-page .input-box.textarea-tall textarea {
    height: 100%;
}

main.sub-content.ai-image-page .input-box.textarea-tall textarea::placeholder,
main.sub-content.ai-image-page .input-box input[type="text"]::placeholder {
    color: var(--rp-text-muted);
}

main.sub-content.ai-image-page .input-box.textarea-tall textarea:focus,
main.sub-content.ai-image-page .input-box input[type="text"]:focus {
    border-color: var(--rp-primary);
    box-shadow: var(--rp-input-shadow);
}

.ai-image-page .ai-image-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.ai-image-page .ai-image-panel-head__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--rp-text);
    white-space: nowrap;
}

.ai-image-page .ai-image-panel-head__title i {
    color: var(--rp-primary);
    font-size: 14px;
}

.ai-image-page .btn-toggle {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: 1px solid var(--rp-border) !important;
    background: var(--rp-surface-alt) !important;
    color: var(--rp-text-muted) !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: color var(--rp-transition), background var(--rp-transition);
}

.ai-image-page .btn-toggle:hover {
    color: var(--rp-text) !important;
    background: color-mix(in srgb, var(--rp-text) 8%, transparent) !important;
    opacity: 1 !important;
}

.ai-image-page .btn-toggle i {
    transition: transform 0.25s ease;
}

main.sub-content.ai-image-page > .prompt-area.is-collapsed {
    width: 56px !important;
    flex: 0 0 56px !important;
    padding: 18px 10px !important;
}

main.sub-content.ai-image-page > .prompt-area.is-collapsed .ai-image-panel-head {
    justify-content: center;
}

main.sub-content.ai-image-page > .prompt-area.is-collapsed .ai-image-panel-head__title span,
main.sub-content.ai-image-page > .prompt-area.is-collapsed form {
    display: none !important;
}

main.sub-content.ai-image-page > .prompt-area.is-collapsed .btn-toggle i {
    transform: rotate(180deg);
}

.ai-image-page .aspect-ratio-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 8px 0 0 !important;
    margin: 0 !important;
    align-items: stretch !important;
    list-style: none;
}

.ai-image-page .aspect-ratio-grid li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    flex: 0 0 calc(20% - 6.4px) !important;
    min-width: 0 !important;
    width: auto !important;
    position: relative;
    overflow: visible !important;
}

.ai-image-page .aspect-ratio-grid input[type="radio"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none;
}

.ai-image-page .aspect-ratio-grid label {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    width: 100% !important;
    min-height: 84px;
    padding: 10px 6px !important;
    box-sizing: border-box !important;
    border-radius: var(--rp-radius-medium, 8px) !important;
    border: 1px solid var(--rp-border) !important;
    background: var(--rp-surface) !important;
    color: var(--rp-text) !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: border-color var(--rp-transition), background var(--rp-transition), box-shadow var(--rp-transition), transform var(--rp-transition);
}

.ai-image-page .aspect-ratio-grid label:hover {
    border-color: var(--rp-primary-border) !important;
    background: color-mix(in srgb, var(--rp-primary) 8%, var(--rp-surface)) !important;
    transform: translateY(-1px);
}

.ai-image-page .aspect-ratio-grid input:checked + label {
    border-color: var(--rp-primary) !important;
    background: linear-gradient(155deg, var(--rp-primary) 0%, var(--rp-gradient-end) 100%) !important;
    box-shadow: var(--rp-shadow-primary-low) !important;
    color: var(--rp-on-brand) !important;
}

.ai-image-page .ratio-box {
    background: color-mix(in srgb, var(--rp-text) 12%, transparent) !important;
    border: 1.5px solid color-mix(in srgb, var(--rp-text) 35%, transparent) !important;
    border-radius: var(--rp-radius-xs, 2px) !important;
    flex-shrink: 0 !important;
    transition: background var(--rp-transition), border-color var(--rp-transition);
}

.ai-image-page .aspect-ratio-grid input:checked + label .ratio-box {
    background: color-mix(in srgb, var(--rp-on-brand) 35%, transparent) !important;
    border-color: var(--rp-on-brand) !important;
}

.ai-image-page .ratio-1-1 { width: 34px !important; height: 34px !important; }
.ai-image-page .ratio-2-3 { width: 26px !important; height: 40px !important; }
.ai-image-page .ratio-3-2 { width: 40px !important; height: 26px !important; }
.ai-image-page .ratio-3-4 { width: 30px !important; height: 40px !important; }
.ai-image-page .ratio-4-3 { width: 40px !important; height: 30px !important; }
.ai-image-page .ratio-4-5 { width: 32px !important; height: 40px !important; }
.ai-image-page .ratio-5-4 { width: 40px !important; height: 32px !important; }
.ai-image-page .ratio-9-16 { width: 24px !important; height: 42px !important; }
.ai-image-page .ratio-16-9 { width: 42px !important; height: 24px !important; }
.ai-image-page .ratio-21-9 { width: 48px !important; height: 20px !important; }

.ai-image-page .ratio-text {
    color: inherit !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: 0.02em;
    text-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

main.sub-content.ai-image-page .prompt-area form .submit {
    margin-top: auto !important;
    padding: 14px 0 0 !important;
    width: 100% !important;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.ai-image-page .btn-submit,
.ai-image-page .btn-submit--full {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    width: 100% !important;
    min-height: 46px;
    padding: 12px 16px !important;
    border: 0 !important;
    border-radius: var(--rp-radius-button, 6px) !important;
    background: linear-gradient(to bottom, var(--rp-primary), var(--rp-gradient-end)) !important;
    color: var(--rp-on-brand) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: var(--rp-shadow-primary-low);
    transition: opacity var(--rp-transition), box-shadow var(--rp-transition);
}

.ai-image-page .btn-submit:hover,
.ai-image-page .btn-submit--full:hover {
    opacity: 0.94;
    box-shadow: var(--rp-shadow-primary-high);
}

.ai-image-page .btn-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

main.sub-content.ai-image-page > .result-area {
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100%;
    align-self: stretch !important;
    margin: 0 !important;
    padding: 18px !important;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column;
    min-height: min(72vh, 780px);
    max-height: calc(100dvh - 160px);
    overflow: hidden;
}

main.sub-content.ai-image-page > .result-area > #response {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    text-align: center !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.ai-image-page .result-img .txt-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: min(52vh, 480px);
    padding: 24px 16px;
    box-sizing: border-box;
}

.ai-image-page .result-img .txt-box figure {
    width: min(160px, 40vw);
    margin: 0;
}

.ai-image-page .result-img .txt-box figure img {
    display: block;
    width: 100%;
    height: auto;
}

.ai-image-page .result-img .txt-box p {
    margin: 0;
    max-width: 36em;
    font-size: 14px;
    line-height: 1.65;
    color: var(--rp-text-muted);
    word-break: keep-all;
}

.ai-image-page .result-img .txt-box p span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: var(--rp-radius-sm);
    background: var(--rp-surface-alt);
    color: var(--rp-text-subtle);
    font-size: 13px;
}

.ai-image-page .result-img .txt-box p em {
    font-style: normal;
    font-weight: 700;
    color: var(--rp-primary);
}

.ai-image-page .result-img .txt-box p i {
    color: var(--rp-primary);
}

.ai-image-page .image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    width: 100%;
}

.ai-image-page .download-all-container {
    text-align: center;
    margin-top: 16px;
}

.ai-image-page .result-img .img-box,
.ai-image-page .swiper .img-box {
    position: relative;
    width: 100%;
    border-radius: var(--rp-radius, 14px);
    overflow: hidden;
    background: var(--rp-surface-alt);
    border: 1px solid var(--rp-border);
}

.ai-image-page .result-img .img-box figure,
.ai-image-page .swiper .img-box figure {
    margin: 0;
    width: 100%;
    display: block;
}

.ai-image-page .result-img .img-box figure img,
.ai-image-page .swiper .img-box figure img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(70vh, 900px);
    object-fit: contain;
    background: var(--rp-chrome);
}

.ai-image-page .main-swiper {
    width: 100% !important;
    max-width: 100%;
}

.ai-image-page .result-img .img-box .tool-list,
.ai-image-page .swiper .img-box .tool-list {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    z-index: 2;
}

.ai-image-page .result-img .img-box .tool-list .tool,
.ai-image-page .swiper .img-box .tool-list .tool {
    position: relative;
}

.ai-image-page .result-img .img-box .tool-list .tool .button,
.ai-image-page .swiper .img-box .tool-list .tool .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--rp-chrome) 72%, transparent);
    border: 1px solid color-mix(in srgb, var(--rp-on-brand) 18%, transparent);
    color: var(--rp-on-brand);
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background var(--rp-transition), transform var(--rp-transition);
}

.ai-image-page .result-img .img-box .tool-list .tool .button:hover,
.ai-image-page .swiper .img-box .tool-list .tool .button:hover {
    background: var(--rp-primary);
    transform: translateY(-1px);
}

.ai-image-page .result-img .img-box .tool-list .tool .tooltip,
.ai-image-page .swiper .img-box .tool-list .tool .tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: var(--rp-radius-field);
    background: var(--rp-chrome);
    color: var(--rp-chrome-title);
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--rp-transition);
}

.ai-image-page .result-img .img-box .tool-list .tool:hover .tooltip,
.ai-image-page .swiper .img-box .tool-list .tool:hover .tooltip {
    opacity: 1;
}

.ai-image-page #response > span {
    display: block;
    padding: 24px 12px;
    color: var(--rp-danger);
    font-size: 14px;
}

@media (max-width: 1200px) {
    main.sub-content.ai-image-page {
        flex-wrap: wrap !important;
    }

    main.sub-content.ai-image-page > .prompt-area {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
        max-height: none;
        min-height: 0;
    }

    main.sub-content.ai-image-page > .prompt-area.is-collapsed {
        width: 100% !important;
        flex: 1 1 100% !important;
        padding: 18px !important;
    }

    main.sub-content.ai-image-page > .prompt-area.is-collapsed .ai-image-panel-head__title span,
    main.sub-content.ai-image-page > .prompt-area.is-collapsed form {
        display: revert !important;
    }

    main.sub-content.ai-image-page > .prompt-area.is-collapsed form {
        display: flex !important;
    }

    .ai-image-page .btn-toggle {
        display: none !important;
    }

    main.sub-content.ai-image-page > .result-area {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-height: 420px;
        max-height: none;
    }

    .ai-image-page .aspect-ratio-grid li {
        flex: 0 0 calc(25% - 6px) !important;
    }
}

@media (max-width: 767px) {
    main.sub-content.ai-image-page {
        gap: 12px;
    }

    main.sub-content.ai-image-page > .prompt-area,
    main.sub-content.ai-image-page > .result-area {
        padding: 14px !important;
        border-radius: var(--rp-radius, 14px);
    }

    main.sub-content.ai-image-page .input-box.textarea-tall {
        height: 160px;
    }

    .ai-image-page .aspect-ratio-grid li {
        flex: 0 0 calc(33.333% - 5.4px) !important;
    }

    .ai-image-page .aspect-ratio-grid label {
        min-height: 76px;
        padding: 8px 4px !important;
    }

    .ai-image-page .ratio-text {
        font-size: 11px !important;
    }

    .ai-image-page .image-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ai-image-page .result-img .txt-box {
        min-height: 280px;
        padding: 16px 8px;
    }

    .ai-image-page .result-img .txt-box p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ai-image-page .aspect-ratio-grid li {
        flex: 0 0 calc(50% - 4px) !important;
    }

    .ai-image-page .ai-image-panel-head__title {
        font-size: 14px;
    }

    .ai-image-page .btn-submit,
    .ai-image-page .btn-submit--full {
        min-height: 44px;
        font-size: 13px !important;
    }
}
