#creator-view { max-width: 1180px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat-avatar-letter { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #38241e; color: #ffd1bd; font: 600 27px var(--brand-font-heading); }

/* Heading, banners, library */
.creator-heading { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin: 6px 0 22px; }
.creator-heading h1 { margin: 8px 0 8px; font: 600 clamp(2rem,4vw,3rem)/1.05 var(--brand-font-heading); letter-spacing: -.05em; }
.creator-heading p { margin: 0; max-width: 610px; color: var(--muted); line-height: 1.55; }
.creator-hero-link,.creator-new { border: 1px solid var(--brand-accent-line); border-radius: 12px; background: var(--brand-accent-soft); color: var(--accent); font-weight: 750; cursor: pointer; }
.creator-hero-link { margin-top: 25px; padding: 12px 17px; }
.creator-hero-link span { padding-left: 8px; }
.creator-new { flex: 0 0 auto; padding: 11px 16px; }
.creator-hero-link:hover,.creator-new:hover { background: rgba(230,106,66,.24); }
.creator-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 16px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.creator-banner p { flex: 1 1 280px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.creator-banner strong { color: var(--text); }
.creator-banner button { border: 1px solid var(--brand-accent-line); border-radius: 10px; padding: 8px 13px; background: var(--brand-accent-soft); color: var(--accent); font-weight: 750; cursor: pointer; }
.creator-banner .creator-banner-quiet { border-color: var(--line); background: transparent; color: var(--muted); }
.creator-banner .creator-banner-dismiss { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 8px; }
.creator-banner-success { border-color: rgba(120,190,140,.35); background: rgba(80,150,100,.1); }
.creator-library-section { margin-bottom: 30px; }
.creator-library-section .section-head { margin-top: 8px; }
.creator-library { display: grid; grid-template-columns: repeat(auto-fill,minmax(340px,1fr)); gap: 10px; }
.creator-library-card { display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: center; gap: 8px 13px; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; background: var(--panel); }
.creator-library-card.editing { border-color: var(--brand-accent-line); }
.creator-library-initial,.creator-avatar,.creator-template-avatar { display: grid; place-items: center; flex: none; background: linear-gradient(135deg,hsl(var(--hue) 42% 34%),hsl(calc(var(--hue) + 40) 48% 18%)); color: hsl(var(--hue) 80% 88%); font-family: var(--brand-font-heading); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.creator-library-initial { width: 46px; height: 46px; border-radius: 12px; font-size: 22px; }
.creator-library-copy { min-width: 0; }
.creator-library-copy strong { display: block; font: 600 17px var(--brand-font-heading); }
.creator-library-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; color: var(--muted); }
.creator-library-actions { grid-column: 1/-1; display: flex; gap: 7px; }
.creator-library-actions button { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; background: var(--raised); font-size: 12px; font-weight: 700; cursor: pointer; }
.creator-library-actions button:first-child { border-color: var(--brand-accent-line); background: var(--brand-accent-soft); color: var(--accent); }
.creator-library-actions .creator-delete { margin-left: auto; border-color: transparent; background: transparent; color: #f3a995; }

/* Ways to start */
.creator-start { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 16px; margin-bottom: 26px; }
.creator-start h2 { margin: 0 0 6px; font: 600 1.25rem/1.25 var(--brand-font-heading); letter-spacing: -.03em; }
.creator-start > div > p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.creator-idea,.creator-templates-wrap { border: 1px solid var(--line); border-radius: 20px; padding: 20px; background: var(--panel); }
.creator-idea { background: linear-gradient(160deg,rgba(230,106,66,.12),transparent 60%),var(--panel); border-color: var(--brand-accent-line); }
.creator-spark { color: var(--accent); }
.creator-idea textarea { width: 100%; min-height: 84px; border: 1px solid #514f50; border-radius: 12px; padding: 12px 13px; background: #101418; color: var(--text); font-size: 15px; line-height: 1.45; resize: vertical; outline: none; field-sizing: content; }
.creator-idea textarea:focus { border-color: var(--accent); }
.creator-idea-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.creator-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.creator-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.creator-ai-button,.creator-primary-button { border: 1px solid var(--accent); border-radius: 11px; padding: 12px 18px; background: var(--accent); color: #1b100c; font-weight: 800; cursor: pointer; }
.creator-ai-button:hover,.creator-primary-button:hover { background: var(--accent2); }
.creator-templates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.creator-template { display: flex; align-items: center; gap: 11px; min-width: 0; border: 1px solid var(--line); border-radius: 13px; padding: 10px 11px; background: var(--raised); text-align: left; cursor: pointer; transition: border-color .15s; }
.creator-template:hover,.creator-template:focus-visible { border-color: var(--brand-accent-line); outline: none; }
.creator-template-avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
.creator-template span { min-width: 0; }
.creator-template strong { display: block; font-size: 14px; }
.creator-template small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }

/* Form layout */
.creator-form { display: grid; grid-template-columns: minmax(0,1fr) 320px; align-items: start; gap: 24px; scroll-margin-top: 84px; }
.creator-main { display: grid; gap: 14px; min-width: 0; }
#creator-sections { display: grid; gap: 14px; }
.creator-section { scroll-margin-top: 84px; border: 1px solid var(--line); border-radius: 20px; padding: 0; background: rgba(22,26,29,.96); }
.creator-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; list-style: none; }
details.creator-section > summary { padding-bottom: 20px; cursor: pointer; }
details.creator-section[open] > summary { padding-bottom: 0; }
.creator-section-head::-webkit-details-marker { display: none; }
.creator-section-title { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.creator-section-head h2 { margin: 0; font: 600 1.35rem/1.2 var(--brand-font-heading); letter-spacing: -.035em; }
.creator-badge { border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .04em; }
.creator-badge.required { border-color: var(--brand-accent-line); color: var(--accent); }
.creator-section-status { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.creator-section-status.complete { color: #9fd3ab; }
.creator-chevron { width: 9px; height: 9px; flex: none; margin: 0 4px 3px 2px; border: solid var(--muted); border-width: 0 2px 2px 0; rotate: 45deg; transition: rotate .15s; }
details[open] .creator-chevron { rotate: 225deg; margin-bottom: -3px; }
.creator-section-note { margin: 6px 22px 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.creator-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 16px; padding: 0 22px 22px; }

/* Fields */
.creator-field { grid-column: 1/-1; min-width: 0; border-radius: 12px; transition: background-color .6s, box-shadow .6s; }
.creator-field.half { grid-column: span 1; }
.creator-label-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.creator-label-row label,.creator-style-fieldset legend { color: #eee5df; font-size: 14px; font-weight: 750; }
.creator-optional,.creator-tag-count { color: var(--muted); font-size: 12px; font-weight: 500; }
.creator-tag-count { margin-left: auto; }
.creator-tag-count.warn { color: #f0b36b; }
.creator-hint { margin: -2px 0 8px; color: #a9a39b; font-size: 12.5px; line-height: 1.45; }
.creator-field input,.creator-field textarea,.creator-field select { width: 100%; border: 1px solid #514f50; border-radius: 11px; padding: 11px 13px; background: #101418; color: var(--text); font-size: 15px; font-weight: 450; line-height: 1.45; outline: none; }
.creator-field textarea { min-height: 70px; resize: vertical; field-sizing: content; max-height: 420px; }
.creator-field textarea[rows="1"] { min-height: 46px; }
.creator-field input::placeholder,.creator-field textarea::placeholder { color: #7f8186; }
.creator-field :is(input,textarea,select):focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,106,66,.15); }
.creator-field.invalid :is(input,textarea,select) { border-color: #e0707a; }
.creator-field-foot { display: flex; justify-content: space-between; gap: 10px; min-height: 0; }
.creator-field-foot:has(.creator-counter:not(:empty)),.creator-field-foot:has(.creator-error:not(.hidden)) { margin-top: 6px; }
.creator-error { margin: 0; color: #f19aa1; font-size: 12.5px; line-height: 1.4; }
.creator-counter { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.creator-counter.warn { color: #f0b36b; }
.creator-field.creator-ai-filled { background: rgba(230,106,66,.1); box-shadow: 0 0 0 8px rgba(230,106,66,.1); }
.creator-pronouns { display: flex; flex-wrap: wrap; gap: 7px; }
.creator-pronouns button { border: 1px solid #514f50; border-radius: 99px; padding: 9px 14px; background: #101418; color: #d8d7d4; font-size: 14px; cursor: pointer; }
.creator-pronouns button.active { border-color: var(--accent); background: #2c201c; color: #ffd1bd; }
.creator-pronouns input { flex: 1 1 150px; width: auto; min-width: 0; }

/* Portrait */
.creator-library-initial img,.creator-avatar img,.creator-template-avatar img,.creator-avatar-large img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.creator-avatar-drop { display: flex; align-items: center; gap: 18px; border: 1.5px dashed transparent; border-radius: 16px; padding: 4px; transition: border-color .15s, background-color .15s; }
.creator-avatar-drop.dragging { border-color: var(--accent); background: var(--brand-accent-soft); }
.creator-avatar-large { position: relative; width: 96px; height: 96px; border-radius: 22px; font-size: 40px; }
.creator-avatar-drop.uploading .creator-avatar-large::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(100deg,transparent 30%,rgba(255,255,255,.28) 50%,transparent 70%) 0 0/240% 100%; animation: shimmer 1.2s infinite; }
.creator-avatar-copy { min-width: 0; }
.creator-avatar-copy .creator-hint { margin-bottom: 10px; }
.creator-avatar-buttons { display: flex; align-items: center; gap: 12px; }
.creator-avatar-buttons .creator-quiet-button { width: auto; padding: 9px 14px; }
.creator-link-button { border: 0; padding: 4px 2px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.creator-link-button:hover { color: #f3a995; }

/* Writing style */
.creator-style-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.creator-style-fieldset legend { margin-bottom: 9px; padding: 0; }
.creator-style-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.creator-style-card { position: relative; display: block; min-width: 0; cursor: pointer; }
.creator-style-card.creator-style-wide { grid-column: span 2; }
.creator-style-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.creator-style-content { display: flex; flex-direction: column; gap: 7px; height: 100%; min-height: 96px; padding: 13px; border: 1px solid #514f50; border-radius: 12px; background: #101418; transition-property: border-color,background-color; transition-duration: .15s; }
.creator-style-content strong { font-size: 14px; line-height: 1.2; }
.creator-style-content strong em { margin-left: 5px; color: var(--muted); font-size: 11px; font-style: normal; font-weight: 600; }
.creator-style-content small { color: #ada9a7; font-size: 12.5px; font-weight: 450; line-height: 1.45; }
.creator-style-card:hover .creator-style-content { border-color: #a97865; }
.creator-style-card input:checked + .creator-style-content { border-color: var(--accent); background: #2c201c; }
.creator-style-card input:checked + .creator-style-content small { color: #e9c3b3; }
.creator-style-card input:focus-visible + .creator-style-content { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Tags */
.creator-tag-pending { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.creator-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.creator-suggestions button,.creator-selected button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; background: var(--raised); color: #d8d7d4; font-size: 13px; cursor: pointer; }
.creator-suggestions button:hover,.creator-suggestions button:focus-visible { border-color: var(--brand-accent-line); color: var(--accent); outline: none; }
.creator-suggestions button.custom { border-style: dashed; border-color: var(--brand-accent-line); color: var(--accent); }
.creator-selected { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.creator-selected:empty { display: none; }
.creator-selected button { border-color: var(--brand-accent-line); background: var(--brand-accent-soft); color: #f7c7b3; }
.creator-selected span { margin-left: 4px; }

/* Error summary */
.creator-error-summary { scroll-margin-top: 84px; border: 1px solid rgba(224,112,122,.5); border-radius: 16px; padding: 15px 18px; background: rgba(224,112,122,.08); outline: none; }
.creator-error-summary strong { display: block; margin-bottom: 6px; color: #ffc9cd; }
.creator-error-summary ul { margin: 0; padding-left: 18px; }
.creator-error-summary button { border: 0; padding: 3px 0; background: none; color: #f19aa1; font-size: 14px; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Aside: preview, sample, meter, nav, actions */
.creator-aside { position: sticky; top: 84px; min-width: 0; }
.creator-aside-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 100px); border: 1px solid var(--line); border-radius: 20px; background: rgba(22,26,29,.96); overflow: hidden; }
.creator-aside-scroll { display: grid; gap: 16px; min-height: 0; padding: 18px; overflow-y: auto; }
.creator-preview { border-radius: 16px; padding: 16px; background: linear-gradient(170deg,#241b18,#15191d); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.creator-preview-top { display: flex; align-items: center; gap: 12px; }
.creator-avatar { width: 48px; height: 48px; border-radius: 50%; font-size: 22px; }
.creator-preview-top strong { display: block; font: 600 19px/1.2 var(--brand-font-heading); overflow-wrap: anywhere; }
.creator-preview-top small { color: var(--muted); font-size: 12px; }
.creator-preview .placeholder { color: #7f8186; }
.creator-preview-role { margin: 12px 0 0; color: #e7ddd5; font-size: 13px; line-height: 1.45; }
.creator-preview-body { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.creator-preview-goal { margin: 10px 0 0; color: #d9cfc8; font-size: 13px; line-height: 1.45; }
.creator-preview-goal b { margin-right: 4px; color: var(--accent); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.creator-preview-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.creator-preview-chips span { border-radius: 99px; padding: 4px 9px; background: rgba(255,255,255,.07); color: #d8d0c9; font-size: 11.5px; }
.creator-quiet-button { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: var(--raised); color: var(--text); font-weight: 700; font-size: 13px; cursor: pointer; }
.creator-quiet-button:hover:not(:disabled) { border-color: var(--brand-accent-line); }
.creator-fill-button span { color: var(--accent); }
.creator-sample-text { margin-top: 10px; border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; color: #e4dcd5; font-size: 13.5px; line-height: 1.55; }
.creator-sample-text p { margin: 0 0 8px; }
.creator-sample-label { display: block; margin-bottom: 6px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.creator-sample-stale { display: none; color: #f0b36b; font-size: 12px; }
.creator-sample-text.stale .creator-sample-stale { display: block; }
.creator-sample-text.stale p { opacity: .6; }
.creator-sample-loading { display: flex; gap: 5px; padding: 8px 0; }
.creator-sample-loading i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: creator-dot 1s infinite ease-in-out; }
.creator-sample-loading i:nth-child(2) { animation-delay: .15s; }
.creator-sample-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes creator-dot { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.creator-meter-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; }
.creator-meter-top b { color: var(--text); font-variant-numeric: tabular-nums; }
.creator-meter-bar,.creator-mini-meter { height: 5px; margin-top: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.creator-meter-bar i,.creator-mini-meter i { display: block; height: 100%; border-radius: inherit; background: #8fc49b; transition: width .2s; }
:is(.creator-meter-bar,.creator-mini-meter) i[data-level="near"] { background: #f0b36b; }
:is(.creator-meter-bar,.creator-mini-meter) i[data-level="over"] { background: #e0707a; }
.creator-meter p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.creator-meter[data-level="over"] p { color: #f19aa1; }
.creator-meter p button { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.creator-nav { display: grid; gap: 2px; }
.creator-nav button { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 0; border-radius: 9px; padding: 8px 10px; background: transparent; color: #d8d7d4; font-size: 13px; text-align: left; cursor: pointer; }
.creator-nav button:hover { background: var(--raised); }
.creator-nav small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.creator-nav button.complete small { color: #9fd3ab; }
.creator-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: #14181c; }
.creator-mini-meter { display: none; }
.creator-actions button { flex: 1 1 auto; }
.creator-secondary-button { border: 1px solid var(--line); border-radius: 11px; padding: 12px 16px; background: var(--raised); font-weight: 800; cursor: pointer; }
.creator-primary-button { flex-grow: 2; }
.creator-cancel { flex-basis: 100%; border: 0; padding: 4px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.creator-cancel:hover { color: var(--accent); }
.creator-form button:disabled,.creator-start button:disabled { opacity: .6; cursor: wait; }
.creator-ai-button.working,.creator-quiet-button.working { opacity: 1; background-image: linear-gradient(100deg,transparent 30%,rgba(255,255,255,.25) 50%,transparent 70%); background-size: 240% 100%; animation: shimmer 1.4s infinite; }
.creator-note { margin: 0; padding: 0 18px 14px; background: #14181c; color: var(--muted); font-size: 11.5px; line-height: 1.45; }

@media (max-width: 1000px) {
  .creator-form { grid-template-columns: 1fr; }
  .creator-aside { position: static; }
  .creator-aside-inner { max-height: none; overflow: visible; }
  .creator-nav { display: none; }
  .creator-actions { position: fixed; z-index: 20; left: var(--rail-w); right: 0; bottom: var(--tab-h,0px); flex-wrap: nowrap; padding: 12px max(16px,calc((100% - 1180px) / 2)) 12px; border-top: 1px solid var(--line); background: rgba(16,19,22,.97); backdrop-filter: blur(16px); }
  .creator-mini-meter { display: block; position: absolute; top: -1px; left: 0; right: 0; height: 3px; margin: 0; border-radius: 0; }
  .creator-cancel { flex: 0 0 auto; order: -1; }
  #creator-view { padding-bottom: calc(var(--tab-h,0px) + 110px); }
  .creator-start { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .creator-heading { display: block; }
  .creator-new { margin-top: 14px; }
  .creator-grid { grid-template-columns: 1fr; padding: 0 16px 18px; }
  .creator-field.half { grid-column: 1/-1; }
  .creator-section-head { padding: 16px 16px 0; }
  details.creator-section > summary { padding-bottom: 16px; }
  .creator-section-note { margin: 6px 16px 14px; }
  .creator-section-status { font-size: 11px; }
  .creator-style-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .creator-templates { grid-template-columns: 1fr; }
  .creator-library { grid-template-columns: 1fr; }
  .creator-idea,.creator-templates-wrap { padding: 16px; }
  .creator-actions button { padding: 12px 10px; }
  .creator-secondary-button { flex: 0 0 auto; }
}
