.aistc-app {
  margin: 0;
  color: #11142f;
  --aistc-ink: #11142f;
  --aistc-muted: #5f617f;
  --aistc-purple: #8b5cf6;
  --aistc-blue: #5368e9;
  --aistc-pink: #ec4ecb;
  --aistc-orange: #ff8a32;
  --aistc-border: rgba(167, 139, 250, 0.32);
}

.aistc-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.34);
  border-radius: 30px;
  background:
    radial-gradient(circle at 7% 12%, rgba(249, 168, 212, 0.18), transparent 22%),
    radial-gradient(circle at 92% 8%, rgba(139, 92, 246, 0.18), transparent 24%),
    radial-gradient(circle at 72% 74%, rgba(129, 140, 248, 0.14), transparent 34%),
    linear-gradient(135deg, #fffaff 0%, #fbf9ff 44%, #f8fbff 100%);
  box-shadow: 0 28px 80px rgba(72, 57, 139, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  padding: clamp(22px, 4.6vw, 48px);
}

.aistc-shell::before,
.aistc-shell::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.aistc-shell::before {
  left: 31px;
  top: 73px;
  width: 13px;
  height: 13px;
  background: #ffdba8;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: .9;
  filter: drop-shadow(0 0 10px rgba(251, 146, 60, .22));
}

.aistc-shell::after {
  right: 30px;
  top: 56px;
  width: 10px;
  height: 10px;
  background: #f0abfc;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: .82;
}

.aistc-shell > * {
  position: relative;
  z-index: 1;
}

.aistc-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
  align-items: start;
  gap: clamp(18px, 3vw, 40px);
  margin-bottom: clamp(22px, 3vw, 32px);
}

.aistc-intro {
  max-width: 870px;
}

.aistc-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(216, 180, 254, 0.28);
  background: linear-gradient(135deg, rgba(236, 216, 255, 0.84), rgba(247, 232, 255, 0.66));
  color: #7e3ccf;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .01em;
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.10);
}

.aistc-badge-spark {
  color: #a855f7;
  font-size: 18px;
  line-height: 1;
}

.aistc-badge-soft {
  background: rgba(245, 235, 255, 0.86);
  color: #8156d9;
}

.aistc-intro h2,
.aistc-result h3 {
  margin: 0 0 12px;
  color: #11142f;
}

.aistc-intro h2 {
  max-width: 900px;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  font-size: clamp(42px, 6.6vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 900;
  text-wrap: balance;
}

.aistc-title-blue,
.aistc-title-pink,
.aistc-title-orange,
.aistc-title-dark {
  display: inline-block;
  filter: drop-shadow(0 10px 18px rgba(94, 92, 230, 0.07));
}

.aistc-title-blue {
  color: #485fda;
}

.aistc-title-pink {
  background: linear-gradient(90deg, #d946ef, #fb4d9a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aistc-title-orange {
  background: linear-gradient(90deg, #ff6f4f, #ffc247, #ff8a1d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aistc-title-dark {
  color: #11142f;
  position: relative;
}

.aistc-title-dark::after {
  content: '';
  position: absolute;
  left: 18%;
  right: 6%;
  bottom: -4px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(236, 72, 153, .28), rgba(139, 92, 246, .32));
  transform: rotate(-1.5deg);
  z-index: -1;
}

.aistc-intro p,
.aistc-result-note {
  margin: 0;
  max-width: 780px;
  color: #666989;
  font-size: 17px;
  line-height: 1.72;
  font-weight: 520;
}

.aistc-result-note {
  font-size: 14px;
  line-height: 1.55;
}

.aistc-hero-art {
  min-height: 180px;
  align-self: start;
  margin-top: -24px;
  transform: translateX(3px);
}

.aistc-hero-art svg {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin-left: auto;
}

.aistc-form {
  display: grid;
  gap: 20px;
}

.aistc-grid {
  display: grid;
  gap: clamp(16px, 2vw, 26px);
}

.aistc-grid-top {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.aistc-field {
  display: grid;
  gap: 9px;
}

.aistc-field > span:first-child {
  color: #34335b;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -.01em;
}

.aistc-select-shell,
.aistc-textarea-shell {
  position: relative;
}

.aistc-select-shell {
  min-height: 54px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(182, 169, 224, 0.44);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(65, 54, 110, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

.aistc-select-shell:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(167, 139, 250, 0.62);
  transform: translateY(-1px);
}

.aistc-select-shell:focus-within {
  border-color: rgba(139, 92, 246, 0.62);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.13), 0 16px 36px rgba(65, 54, 110, 0.09);
  background: #fff;
}

.aistc-select-shell::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid #34335b;
  border-bottom: 2px solid #34335b;
  transform: translateY(-62%) rotate(45deg);
  opacity: .8;
  pointer-events: none;
}

.aistc-select-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8b5cf6;
  background: linear-gradient(135deg, rgba(245, 208, 254, 0.76), rgba(221, 214, 254, 0.64));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 20px rgba(139,92,246,.12);
  transform: translateY(-50%);
  pointer-events: none;
}

.aistc-field-tone .aistc-select-icon,
.aistc-field-length .aistc-select-icon {
  color: #ff8a32;
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.9), rgba(254, 215, 170, 0.64));
}

.aistc-field-language .aistc-select-icon,
.aistc-field-pov .aistc-select-icon {
  color: #7c3aed;
  background: linear-gradient(135deg, rgba(237, 233, 254, 0.9), rgba(219, 234, 254, 0.68));
}

.aistc-select-icon svg {
  width: 20px;
  height: 20px;
}

.aistc-select-icon svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aistc-field select,
.aistc-field textarea {
  width: 100%;
  color: #222143;
  outline: none;
  font: inherit;
}

.aistc-field select {
  min-height: 54px;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  padding: 0 48px 0 60px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.aistc-field textarea {
  min-height: 156px;
  resize: vertical;
  padding: 22px 68px 22px 22px;
  border: 1px solid rgba(167, 139, 250, 0.54);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 12px 32px rgba(139, 92, 246, 0.06);
  line-height: 1.68;
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.aistc-field textarea::placeholder {
  color: rgba(104, 102, 133, 0.72);
  font-style: italic;
}

.aistc-field textarea:focus {
  border-color: rgba(139, 92, 246, 0.78);
  background: rgba(255,255,255,0.94);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15), 0 18px 40px rgba(139, 92, 246, 0.08);
}

.aistc-magic-mark {
  position: absolute;
  right: 20px;
  top: 0;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #b54cf1;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 28px rgba(139, 92, 246, .17), inset 0 1px 0 rgba(255,255,255,.94);
  transform: translateY(-8px);
  pointer-events: none;
}

.aistc-magic-mark svg {
  width: 23px;
  height: 23px;
}

.aistc-magic-mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aistc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.aistc-primary,
.aistc-secondary,
.aistc-mini,
.aistc-tab,
.aistc-editor-toolbar button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, background .16s ease, color .16s ease;
}

.aistc-primary {
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6447f5 0%, #be4ff6 48%, #ff6584 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(210, 75, 196, 0.30), inset 0 1px 0 rgba(255,255,255,.28);
  letter-spacing: .01em;
}

.aistc-secondary,
.aistc-mini {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #565174;
  border: 1px solid rgba(182, 169, 224, 0.32);
  box-shadow: 0 10px 28px rgba(65, 54, 110, 0.06);
}

.aistc-secondary {
  min-height: 54px;
  padding: 0 24px;
}

.aistc-mini-danger {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.10);
}

.aistc-primary:hover,
.aistc-secondary:hover,
.aistc-mini:hover,
.aistc-editor-toolbar button:hover {
  transform: translateY(-1px);
}

.aistc-primary:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.aistc-limit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(245, 235, 255, 0.72);
  color: #9175c8;
  font-size: 13px;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.aistc-result,
.aistc-error {
  margin-top: 24px;
  border-radius: 24px;
}

.aistc-result {
  border: 1px solid rgba(167, 139, 250, 0.24);
  background: rgba(255,255,255,0.82);
  padding: clamp(18px, 3vw, 26px);
}

.aistc-result h3 {
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.aistc-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.16);
}

.aistc-tab {
  position: relative;
  padding: 0 14px 12px;
  background: transparent;
  color: #64748b;
}

.aistc-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.15);
  color: #7c3aed;
  font-size: 12px;
}

.aistc-tab.is-active {
  color: #7c3aed;
}

.aistc-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(135deg, #7c3aed, #f472b6);
}

.aistc-tab-panel[hidden] {
  display: none !important;
}

.aistc-result-head,
.aistc-history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.aistc-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.aistc-editor-wrap {
  overflow: hidden;
  border: 1px solid rgba(100, 116, 139, 0.22);
  border-radius: 20px;
  background: rgba(255,255,255,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92);
}

.aistc-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.16);
  background: rgba(248, 250, 252, 0.86);
}

.aistc-editor-toolbar button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  font-size: 13px;
}

.aistc-editor-toolbar button:hover {
  background: rgba(167, 139, 250, 0.13);
  color: #6d28d9;
}

.aistc-toolbar-sep {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: rgba(100, 116, 139, 0.20);
}

.aistc-editor {
  min-height: 280px;
  padding: 18px;
  color: #172033;
  font-size: 16px;
  line-height: 1.78;
  outline: none;
  white-space: normal;
}

.aistc-editor:focus {
  box-shadow: inset 0 0 0 4px rgba(167, 139, 250, 0.10);
}

.aistc-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.aistc-editor p {
  margin: 0 0 1em;
}

.aistc-editor p:last-child {
  margin-bottom: 0;
}

.aistc-editor h2,
.aistc-editor h3 {
  margin: 1.1em 0 .45em;
  color: #0f172a;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.aistc-editor h2:first-child,
.aistc-editor h3:first-child {
  margin-top: 0;
}

.aistc-editor blockquote {
  margin: 1em 0;
  padding: 10px 14px;
  border-left: 4px solid rgba(139, 92, 246, 0.45);
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.06);
  color: #334155;
}

.aistc-error {
  padding: 14px 16px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(254, 242, 242, 0.92);
  color: #991b1b;
  font-weight: 800;
}

.aistc-history-empty {
  padding: 18px;
  border: 1px dashed rgba(100, 116, 139, 0.28);
  border-radius: 18px;
  color: #64748b;
  background: rgba(248, 250, 252, 0.68);
  font-weight: 700;
}

.aistc-history-list {
  display: grid;
  gap: 12px;
}

.aistc-history-item {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(100, 116, 139, 0.18);
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
}

.aistc-history-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.aistc-history-item-top strong {
  color: #0f172a;
  font-size: 15px;
}

.aistc-history-item-top span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.aistc-history-item p {
  margin: 0;
  color: #475569;
  line-height: 1.55;
  font-size: 14px;
}

.aistc-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .aistc-hero-top {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  }

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

@media (max-width: 760px) {
  .aistc-shell {
    border-radius: 24px;
    padding: 20px;
  }

  .aistc-hero-top {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .aistc-hero-art {
    order: -1;
    min-height: 120px;
    margin: -12px 0 -8px;
    opacity: .9;
  }

  .aistc-hero-art svg {
    width: min(76%, 280px);
    margin: 0 auto;
  }

  .aistc-intro h2 {
    font-size: clamp(36px, 13vw, 54px);
    letter-spacing: -0.065em;
  }

  .aistc-intro p {
    font-size: 15px;
  }

  .aistc-grid-top,
  .aistc-grid-bottom {
    grid-template-columns: 1fr;
  }

  .aistc-field textarea {
    min-height: 190px;
    padding-right: 54px;
  }

  .aistc-actions,
  .aistc-result-head,
  .aistc-history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .aistc-primary,
  .aistc-secondary,
  .aistc-mini {
    width: 100%;
  }

  .aistc-result-actions,
  .aistc-history-actions {
    justify-content: stretch;
  }

  .aistc-tabs {
    overflow-x: auto;
  }

  .aistc-editor-toolbar {
    gap: 4px;
  }

  .aistc-editor-toolbar button {
    flex: 1 1 auto;
  }

  .aistc-toolbar-sep {
    display: none;
  }

  .aistc-editor {
    min-height: 230px;
    padding: 15px;
  }

  .aistc-history-item-top {
    flex-direction: column;
  }
}


/* AI Story Continuer: title/art correction v20260521-full-route-design-fix-5 */
.aistc-hero-top {
  position: relative;
  display: block;
  min-height: 205px;
  margin-bottom: clamp(20px, 2.8vw, 30px);
  padding-right: clamp(310px, 31vw, 440px);
}

.aistc-intro {
  max-width: none;
  padding-top: 4px;
}

.aistc-intro > .aistc-badge:first-child {
  display: none !important;
}

.aistc-intro h2 {
  max-width: none;
  margin-top: 0;
  margin-bottom: 14px;
  font-size: clamp(46px, 5.05vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.062em;
  white-space: nowrap;
  text-wrap: nowrap;
  overflow: visible;
}

.aistc-title-blue,
.aistc-title-pink,
.aistc-title-orange,
.aistc-title-dark {
  display: inline;
  white-space: nowrap;
}

.aistc-title-dark::after {
  bottom: -2px;
  height: 6px;
}

.aistc-intro p {
  max-width: 660px;
}

.aistc-hero-art {
  position: absolute;
  z-index: 0;
  top: -34px;
  right: -8px;
  width: clamp(285px, 31vw, 430px);
  min-height: 0;
  margin: 0;
  transform: none;
  pointer-events: none;
}

.aistc-hero-art img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 34px rgba(98, 73, 210, 0.14));
}

.aistc-hero-art svg {
  display: none !important;
}

@media (max-width: 1180px) {
  .aistc-hero-top {
    padding-right: clamp(260px, 28vw, 330px);
  }
  .aistc-intro h2 {
    font-size: clamp(40px, 4.8vw, 58px);
    letter-spacing: -0.058em;
  }
  .aistc-hero-art {
    width: clamp(245px, 28vw, 330px);
    top: -20px;
  }
}

@media (max-width: 860px) {
  .aistc-hero-top {
    display: grid;
    grid-template-columns: 1fr;
    padding-right: 0;
    min-height: 0;
  }
  .aistc-intro h2 {
    white-space: normal;
    text-wrap: balance;
    font-size: clamp(38px, 10vw, 56px);
  }
  .aistc-hero-art {
    position: relative;
    top: auto;
    right: auto;
    width: min(78vw, 360px);
    margin: -4px auto -6px;
  }
}

@media (max-width: 520px) {
  .aistc-intro h2 {
    letter-spacing: -0.05em;
  }
}

/* AI Story Continuer: full-width app stage, mobile result flow and loading progress v20260521-mobile-center-no-magic-9 */
.page-app-ai-story-continuer .app-stage-section-direct {
  padding-top: clamp(18px, 3vw, 38px);
}

.page-app-ai-story-continuer .app-stage-container-direct {
  max-width: min(100%, 1560px);
}

.page-app-ai-story-continuer .app-stage-panel-direct,
.page-app-ai-story-continuer .app-main-panel.app-stage-panel.app-stage-panel-direct {
  width: 100%;
  max-width: none;
  padding: 0 !important;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.page-app-ai-story-continuer .app-stage-panel-direct > .aistc-app {
  width: 100%;
}

.page-app-ai-story-continuer .aistc-app {
  width: 100%;
}

.aistc-generating {
  margin-top: 22px;
}

.aistc-generating[hidden] {
  display: none !important;
}

.aistc-generating-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px 20px;
  border: 1px solid rgba(167, 139, 250, 0.34);
  border-radius: 24px;
  background:
    radial-gradient(circle at 7% 20%, rgba(244, 114, 182, .16), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(250,245,255,.88));
  box-shadow: 0 22px 54px rgba(83, 58, 157, 0.12), inset 0 1px 0 rgba(255,255,255,.95);
  overflow: hidden;
}

.aistc-writer-orb {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #6d5df5, #d84adf 58%, #ff7b75);
  box-shadow: 0 18px 38px rgba(190, 79, 246, .25);
}

.aistc-writer-orb::before {
  content: '✦';
  color: #fff;
  font-size: 24px;
  line-height: 1;
  animation: aistcSparkPulse 1.35s ease-in-out infinite;
}

.aistc-writer-orb span,
.aistc-writer-orb i {
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 1px solid rgba(139, 92, 246, .28);
  animation: aistcOrbRing 1.55s ease-out infinite;
}

.aistc-writer-orb i {
  inset: -13px;
  animation-delay: .28s;
  opacity: .55;
}

.aistc-generating-copy {
  display: grid;
  gap: 4px;
}

.aistc-generating-copy strong {
  color: #181735;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.aistc-generating-copy span {
  color: #696585;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.aistc-progress-num {
  min-width: 58px;
  padding: 9px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #7c3aed;
  text-align: center;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 10px 24px rgba(124,58,237,.10);
}

.aistc-progress-track {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  background: rgba(226, 218, 255, .72);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(70, 55, 130, .10);
}

.aistc-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d5df5, #c54fed, #ff7b75);
  box-shadow: 0 0 20px rgba(197, 79, 237, .32);
  transition: width .34s ease;
}

.aistc-is-generating .aistc-progress-track span {
  background-size: 180% 100%;
  animation: aistcProgressGlow 1.05s linear infinite;
}

@keyframes aistcProgressGlow {
  0% { background-position: 0 0; }
  100% { background-position: 180% 0; }
}

@keyframes aistcSparkPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: .9; }
  50% { transform: scale(1.18) rotate(10deg); opacity: 1; }
}

@keyframes aistcOrbRing {
  0% { transform: scale(.82); opacity: .78; }
  100% { transform: scale(1.22); opacity: 0; }
}

.aistc-result {
  margin-top: clamp(28px, 4vw, 44px);
  padding: clamp(22px, 3.8vw, 48px);
  border: 1px solid rgba(185, 172, 230, 0.52);
  border-radius: 34px;
  background:
    radial-gradient(circle at 93% 4%, rgba(167, 139, 250, .10), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.86));
  box-shadow: 0 28px 76px rgba(72, 57, 139, 0.12), inset 0 1px 0 rgba(255,255,255,.96);
}

.aistc-tabs {
  gap: 24px;
  margin-bottom: 28px;
  padding-left: 2px;
  border-bottom: 1px solid rgba(118, 103, 166, 0.16);
}

.aistc-tab {
  padding: 0 4px 22px;
  color: #3c3c63;
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1;
  letter-spacing: -.025em;
}

.aistc-tab.is-active {
  color: #7a32ee;
}

.aistc-tab.is-active::after {
  height: 4px;
  left: 0;
  right: 0;
  bottom: -2px;
  background: linear-gradient(90deg, #7434f3, #a64cff);
}

.aistc-tab span {
  min-width: 30px;
  height: 30px;
  margin-left: 8px;
  background: rgba(126, 87, 237, .12);
  color: #66558c;
  font-size: 16px;
  font-weight: 950;
}

.aistc-result-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(18px, 3vw, 44px);
  margin-bottom: clamp(22px, 3vw, 34px);
}

.aistc-result-head .aistc-badge-soft {
  margin-bottom: 22px;
  padding: 14px 26px;
  border-radius: 999px;
  border-color: rgba(180, 157, 236, .42);
  background: linear-gradient(135deg, rgba(245, 239, 255, .98), rgba(255, 255, 255, .76));
  color: #7c3aed;
  font-size: 16px;
  box-shadow: 0 16px 36px rgba(124, 58, 237, .08), inset 0 1px 0 rgba(255,255,255,.95);
}

.aistc-result-head .aistc-badge-soft::before {
  content: '✎';
  font-size: 19px;
  line-height: 1;
}

.aistc-result h3 {
  margin-bottom: 14px;
  color: #11142f;
  font-size: clamp(34px, 3.8vw, 54px);
  line-height: .98;
  letter-spacing: -.055em;
}

.aistc-result-note {
  max-width: 670px;
  color: #5f617f;
  font-size: clamp(16px, 1.35vw, 21px);
  line-height: 1.52;
  font-weight: 540;
}

.aistc-result-actions {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 18px;
  justify-content: end;
  align-items: start;
}

.aistc-result-actions .aistc-mini {
  min-height: 70px;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 26px;
  border-radius: 18px;
  border: 1px solid rgba(183, 169, 224, .58);
  background: rgba(255,255,255,.86);
  color: #343653;
  font-size: 17px;
  box-shadow: 0 18px 36px rgba(72, 57, 139, .08), inset 0 1px 0 rgba(255,255,255,.96);
}

.aistc-result-actions .aistc-mini:hover {
  border-color: rgba(124, 58, 237, .40);
  box-shadow: 0 20px 42px rgba(72, 57, 139, .11), inset 0 1px 0 rgba(255,255,255,.96);
}

.aistc-result-actions .aistc-mini::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d28d9;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.aistc-result-actions [data-ai-story-copy]::before { content: '▣'; }
.aistc-result-actions [data-ai-story-save]::before { content: '▱'; font-size: 27px; transform: rotate(90deg); }
.aistc-result-actions [data-ai-story-download]::before { content: '↓'; font-size: 31px; }
.aistc-result-actions [data-ai-story-more]::before { content: '✦'; font-size: 24px; }

.aistc-result-actions [data-ai-story-download],
.aistc-result-actions [data-ai-story-more] {
  color: #7c3aed;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(245, 239, 255, .96));
}

.aistc-result-actions [data-ai-story-more] {
  grid-column: 3;
  min-width: 190px;
}

.aistc-editor-wrap {
  border: 1px solid rgba(183, 169, 224, .62);
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 16px 34px rgba(72, 57, 139, .06), inset 0 1px 0 rgba(255,255,255,.96);
}

.aistc-editor-toolbar {
  min-height: 72px;
  gap: 18px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(183, 169, 224, .38);
  background: rgba(255,255,255,.66);
}

.aistc-editor-toolbar button {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #313756;
  font-size: 15px;
  font-weight: 950;
}

.aistc-editor-toolbar button:hover {
  background: rgba(124, 58, 237, .10);
  color: #6d28d9;
}

.aistc-editor {
  min-height: clamp(270px, 27vw, 360px);
  padding: 34px 40px;
  color: #20243d;
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.78;
}

.aistc-editor:empty::before {
  color: #8e92aa;
  font-size: clamp(16px, 1.25vw, 20px);
}

@media (max-width: 1120px) {
  .aistc-result-head {
    grid-template-columns: 1fr;
  }
  .aistc-result-actions {
    justify-content: start;
  }
  .aistc-result-actions [data-ai-story-more] {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .page-app-ai-story-continuer .app-stage-section-direct {
    padding-top: 10px;
  }
  .page-app-ai-story-continuer .app-stage-container-direct {
    padding-left: 12px;
    padding-right: 12px;
  }
  .aistc-shell {
    border-radius: 22px;
    padding: 16px;
  }
  .aistc-app:not(.aistc-has-generated) .aistc-result {
    display: none;
  }
  .aistc-generating-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
    border-radius: 20px;
  }
  .aistc-progress-num {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .aistc-progress-track {
    grid-column: 1 / -1;
  }
  .aistc-writer-orb {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }
  .aistc-generating-copy strong {
    font-size: 16px;
  }
  .aistc-result {
    margin-top: 18px;
    padding: 16px;
    border-radius: 22px;
  }
  .aistc-tabs {
    gap: 18px;
    margin-bottom: 18px;
  }
  .aistc-tab {
    padding-bottom: 15px;
    font-size: 18px;
  }
  .aistc-tab span {
    min-width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .aistc-result-head {
    gap: 16px;
    margin-bottom: 18px;
  }
  .aistc-result-head .aistc-badge-soft {
    margin-bottom: 14px;
    padding: 11px 16px;
    font-size: 14px;
  }
  .aistc-result h3 {
    font-size: clamp(30px, 11vw, 42px);
  }
  .aistc-result-note {
    font-size: 15px;
  }
  .aistc-result-actions {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }
  .aistc-result-actions .aistc-mini {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 0 12px;
    border-radius: 15px;
    font-size: 14px;
    gap: 8px;
  }
  .aistc-result-actions [data-ai-story-download],
  .aistc-result-actions [data-ai-story-more] {
    grid-column: auto;
  }
  .aistc-editor-wrap {
    border-radius: 18px;
  }
  .aistc-editor-toolbar {
    min-height: 0;
    gap: 5px;
    padding: 9px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .aistc-editor-toolbar button {
    flex: 0 0 auto;
    min-height: 36px;
    font-size: 13px;
  }
  .aistc-editor {
    min-height: 250px;
    padding: 18px;
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .aistc-result-actions {
    grid-template-columns: 1fr;
  }
}


/* AI Story Continuer: mobile full-width + clean action icons v20260521-mobile-center-no-magic-9 */
.aistc-result-head .aistc-badge-soft {
  display: none !important;
}

.aistc-result-actions {
  grid-template-columns: repeat(3, max-content) !important;
}

.aistc-result-actions [data-ai-story-more] {
  display: none !important;
}

.aistc-result-actions .aistc-mini::before {
  content: none !important;
  display: none !important;
}

.aistc-result-actions .aistc-mini svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  color: #6d28d9;
}

.aistc-result-actions .aistc-mini svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aistc-result-actions .aistc-mini span {
  display: inline-block;
}

.aistc-editor-toolbar [data-ai-story-command="removeFormat"] {
  color: #7c3aed;
}

@media (max-width: 760px) {
  .page-app-ai-story-continuer .section-page-body.app-stage-section-direct,
  .page-app-ai-story-continuer .app-stage-section-direct {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
  }

  .page-app-ai-story-continuer .app-stage-container-direct,
  .page-app-ai-story-continuer .container.app-stage-container-direct {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .page-app-ai-story-continuer .app-stage-panel-direct,
  .page-app-ai-story-continuer .app-main-panel.app-stage-panel.app-stage-panel-direct {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .page-app-ai-story-continuer .aistc-app,
  .page-app-ai-story-continuer .aistc-shell {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .page-app-ai-story-continuer .aistc-shell {
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    padding: 16px 12px !important;
  }

  .aistc-result-actions,
  .aistc-editor-toolbar {
    display: none !important;
  }

  .aistc-result {
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .aistc-editor-wrap {
    border-radius: 18px !important;
  }
}


/* AI Story Continuer: hard mobile viewport width fix v20260521-mobile-center-no-magic-9 */
@media (max-width: 760px) {
  html, body {
    overflow-x: hidden !important;
  }

  .app-stage-section-direct,
  body .app-stage-section-direct,
  .section-page-body.app-stage-section-direct {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  .app-stage-container-direct,
  body .app-stage-container-direct,
  .container.app-stage-container-direct {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .app-stage-panel-direct,
  body .app-stage-panel-direct,
  article.app-stage-panel-direct {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    overflow: visible !important;
  }

  .aistc-app,
  .aistc-shell,
  .aistc-form,
  .aistc-result {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  .aistc-shell {
    margin: 0 !important;
    border-radius: 0 !important;
  }
}


/* AI Story Continuer: mobile intro center + removed magic icon v20260521-mobile-center-no-magic-9 */
.aistc-textarea-shell .aistc-magic-mark {
  display: none !important;
}

.aistc-field textarea {
  padding-right: 22px;
}

@media (max-width: 760px) {
  .aistc-hero-top {
    text-align: center !important;
  }

  .aistc-intro {
    width: 100% !important;
    max-width: none !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .aistc-intro h2 {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .aistc-intro p {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 94% !important;
  }

  .aistc-field textarea {
    padding-right: 16px !important;
  }
}

/* AI Story Continuer: 3-tier pricing block + route-safe update v20260521-safe-pricing-14 */
.aistc-plans {
  margin: clamp(22px, 4vw, 34px) 0;
  border-radius: 32px;
  border: 1px solid rgba(167, 139, 250, .26);
  background:
    radial-gradient(circle at 8% 0%, rgba(96, 165, 250, .18), transparent 32%),
    radial-gradient(circle at 92% 12%, rgba(236, 72, 153, .16), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,255,.96));
  box-shadow: 0 22px 60px rgba(66, 56, 128, .09);
  padding: clamp(18px, 3.4vw, 30px);
  overflow: hidden;
}
.aistc-plans-head {
  max-width: 780px;
  margin: 0 auto clamp(18px, 3vw, 26px);
  text-align: center;
}
.aistc-plans-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(124, 58, 237, .1);
  color: #6d28d9;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .11em;
}
.aistc-plans-head h3 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: .98;
  letter-spacing: -.055em;
  color: #11142f;
}
.aistc-plans-head p {
  margin: 0;
  color: #61647a;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.58;
}
.aistc-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.aistc-plan-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.aistc-plan-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 26px;
  border: 1px solid rgba(203, 213, 225, .92);
  background: rgba(255,255,255,.92);
  box-shadow: 0 14px 34px rgba(34, 42, 87, .07);
  padding: 20px;
}
.aistc-plan-card-plus {
  border-color: rgba(236, 72, 153, .34);
  background: linear-gradient(135deg, #fff, #fff7fb);
}
.aistc-plan-card-pro {
  border-color: rgba(124, 58, 237, .38);
  background: linear-gradient(135deg, #fff, #f7f3ff);
  box-shadow: 0 20px 46px rgba(124, 58, 237, .13);
}
.aistc-plan-top {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.aistc-plan-label {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 11px;
  background: rgba(15, 23, 42, .06);
  color: #1f2937;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.aistc-plan-top strong {
  display: block;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -.055em;
  color: #15172f;
}
.aistc-plan-top small {
  font-size: 14px;
  letter-spacing: 0;
  color: #6b7280;
  font-weight: 800;
}
.aistc-plan-card p {
  margin: 0 0 14px;
  color: #5d6074;
  line-height: 1.55;
}
.aistc-plan-card ul {
  display: grid;
  gap: 9px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.aistc-plan-card li {
  position: relative;
  padding-left: 25px;
  color: #2f3347;
  line-height: 1.45;
  font-size: 14px;
}
.aistc-plan-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .18em;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
}
.aistc-plan-card li::after {
  content: '';
  position: absolute;
  left: 6px;
  top: .48em;
  width: 5px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(42deg);
}
.aistc-plan-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #9333ea 56%, #ec4899);
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(124, 58, 237, .18);
}
.aistc-plan-btn-ghost {
  color: #312e81;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(124, 58, 237, .24);
  box-shadow: none;
}
@media (max-width: 920px) {
  .aistc-plan-grid,
  .aistc-plan-grid-three {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .aistc-plans {
    width: 100%;
    border-radius: 24px;
    padding: 16px;
  }
  .aistc-plans-head h3 {
    font-size: 30px;
  }
  .aistc-plan-card {
    border-radius: 20px;
    padding: 17px;
  }
}

/* AI Story Continuer auth live status fix v20260521-auth-status-19 */
.aistc-account-strip{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin:18px 0 22px;
    padding:14px 16px;
    border:1px solid rgba(124,58,237,.16);
    border-radius:24px;
    background:rgba(255,255,255,.72);
    box-shadow:0 16px 42px rgba(43,43,92,.08);
    backdrop-filter:blur(12px);
}
.aistc-account-copy{display:grid;gap:3px;min-width:0}.aistc-account-copy strong{font-size:15px;color:#191b3c}.aistc-account-copy span{font-size:13px;color:#667085}.aistc-account-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}.aistc-account-actions a{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 13px;border-radius:999px;text-decoration:none;font-weight:900;font-size:13px;color:#4c1d95;background:#fff;border:1px solid rgba(124,58,237,.18);box-shadow:0 10px 24px rgba(76,29,149,.08)}.aistc-account-actions a:nth-child(2),.aistc-account-actions a.is-primary{color:#fff;border-color:transparent;background:linear-gradient(135deg,#6366f1,#ec4899)}
@media(max-width:720px){.aistc-account-strip{display:grid;text-align:center;margin:14px 0 18px;padding:14px 12px;border-radius:20px}.aistc-account-actions{justify-content:center}.aistc-account-actions a{flex:1 1 auto;min-width:110px}}
