.cuddle {
  --cu-bg: #15131b;
  --cu-surface: #1d1a25;
  --cu-line: #393241;
  --cu-text: #f4f1fa;
  --cu-muted: #b4adbf;
  --cu-iris: #d5bcff;
  --cu-focus: #b997f7;
  position: fixed;
  z-index: 16;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  color: var(--cu-text);
  color-scheme: dark;
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.cuddle *, .cuddle *::before, .cuddle *::after {box-sizing: border-box}
.cuddle [hidden] {display: none !important}
.cuddle :is(p, h2, h3, ul, ol, dl, dd) {margin: 0}
.cuddle :is(button,textarea) {font: inherit}
.cuddle button {cursor: pointer; touch-action: manipulation}
.cuddle button:disabled {opacity: .45; cursor: default}
.cuddle :is(button, a, summary):focus-visible {outline: 2px solid var(--cu-focus); outline-offset: 3px}
.cuddle svg {display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round}
.cu-launch {padding: 9px 17px 9px 13px; min-height: 43px; display: flex; align-items: center; gap: 9px; background: #302438; border: 1px solid #806295; border-radius: 24px; color: #f4eaff; font-weight: 600 !important; box-shadow: 0 4px 16px #0005}
.cu-launch svg,.cu-symbol svg,.cu-orbit svg {fill: #c9adf8; stroke: none}
.cu-panel {display: grid; grid-template-rows: auto minmax(0,1fr) auto; width: min(466px,calc(100vw - 38px)); height: min(760px,calc(100dvh - 48px)); overflow: hidden; border: 1px solid #55465f; border-radius: 21px; background: var(--cu-bg); box-shadow: 0 25px 80px #05030993, 0 3px 16px #0005; animation: cu-appear .16s ease-out}
.cu-wide .cu-panel {width: min(740px,calc(100vw - 40px)); height: min(860px,calc(100dvh - 40px))}
.cu-head {display: flex; align-items: center; gap: 10px; padding: 15px 16px 14px 19px; border-bottom: 1px solid var(--cu-line); background: #1b1721}
.cu-symbol,.cu-orbit,.cu-starter-icon,.cu-choice-icon {display: inline-grid; place-items: center; flex: none}
.cu-symbol {width: 37px; height: 37px; border: 1px solid #544062; border-radius: 12px; background: #32253d}
.cu-heading {flex: 1; min-width: 0}
.cu-heading h2 {font-size: 16px; line-height: 1.25; letter-spacing: -.025em; font-weight: 650}
.cu-context {color: var(--cu-muted); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis}
.cu-tools {display: flex; gap: 2px}
.cu-tool {width: 32px; height: 34px; display: grid; place-items: center; color: var(--cu-muted); background: transparent; border: 0; border-radius: 8px}
.cu-tool:hover {color: var(--cu-text); background: #302937}
.cu-tool svg {width: 16px; height: 16px}
.cu-feed {min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #51485b transparent; scrollbar-gutter: stable; padding: 20px 19px 13px}
.cu-start {display: grid; align-content: center; gap: 23px; min-height: 100%; max-width: 480px; margin: 0 auto; padding: 20px 7px 38px}
.cu-intro {display: grid; justify-items: start; gap: 18px}
.cu-orbit {width: 47px; height: 47px; border: 1px solid #614873; border-radius: 16px; background: linear-gradient(145deg,#3d2d4a,#261e31); box-shadow: 0 9px 30px #09050d38}
.cu-orbit svg {width: 25px; height: 25px}
.cu-start h3 {font-size: clamp(22px,3vw,29px); line-height: 1.18; font-weight: 550; letter-spacing: -.047em}
.cu-starters,.cu-choices {display: grid; gap: 7px}
.cu-starter,.cu-choice {display: flex; align-items: center; gap: 12px; min-height: 46px; width: 100%; text-align: left; border: 1px solid var(--cu-line); border-radius: 12px; background: #201c27; color: var(--cu-text); padding: 9px 12px; transition: background .12s,border-color .12s}
.cu-starter:hover,.cu-choice:hover,.cu-secondary:hover {border-color: #79628e; background: #292231}
.cu-starter-icon,.cu-choice-icon {color: #bda4da}
.cu-option-arrow {margin-left: auto; color: #998aa8}
.cu-option-arrow svg {width: 14px; height: 14px}
.cu-thread {display: grid; align-content: start; gap: 13px; max-width: 630px; margin: 0 auto}
.cu-thread:empty {display: none}
.cu-user,.cu-reply {font-size: 14px; line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere}
.cu-user {justify-self: end; max-width: 86%; padding: 8px 13px; background: #352a40; color: #f3e9ff; border: 1px solid #4a3958; border-radius: 16px 16px 4px 16px}
.cu-reply {justify-self: start; max-width: 100%; padding: 2px 2px}
.cu-wait {display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cu-muted)}
.cu-wait::before {content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cu-iris); animation: cu-pulse 1s ease-in-out infinite alternate}
.cu-card {display: grid; gap: 11px; padding: 14px; min-width: 0; background: var(--cu-surface); border: 1px solid #42364e; border-radius: 14px}
.cu-card-meta,.cu-help,.cu-choice-copy small {color: var(--cu-muted); font-size: 12px}
.cu-card-title {font-size: 16px; font-weight: 580; line-height: 1.4; letter-spacing: -.018em}
.cu-choice {background: #26212e; border-color: #493b53}
.cu-choice-icon {width: 31px; height: 31px; border-radius: 9px; background: #342b3e}
.cu-choice-copy {min-width: 0; display: grid}
.cu-choice-copy strong {font-size: 13px; font-weight: 600; overflow-wrap: anywhere}
.cu-metric {display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; line-height: 1.2}
.cu-metric strong {font-size: 31px; font-weight: 580; letter-spacing: -.05em}
.cu-metric span {font-size: 14px; font-weight: 500}
.cu-amount,.cu-rows,.cu-metric {font-variant-numeric: tabular-nums}
.cu-amount {color: #e7d9f5; font-size: 13px}
.cu-details {font-size: 12px; border-top: 1px solid var(--cu-line); padding-top: 8px}
.cu-details:first-child {padding-top: 0; border: 0}
.cu-details summary {cursor: pointer; color: #d6cade}
.cu-rows {margin-top: 7px !important; list-style: none; padding: 0; max-height: 196px; overflow: auto; overscroll-behavior: contain}
.cu-rows li {display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: 9px; padding: 5px 0; overflow-wrap: anywhere}
.cu-rows li+li {border-top: 1px solid var(--cu-line)}
.cu-rows strong {text-align: right; font-weight: 540}
.cu-card-actions {display: flex; gap: 10px; align-items: center; flex-wrap: wrap}
.cu-primary,.cu-secondary {width: fit-content; min-height: 36px; padding: 7px 12px; border-radius: 9px; font-weight: 550 !important; font-size: 13px !important}
.cu-primary {border: 1px solid transparent; color: #251833; background: var(--cu-iris)}
.cu-primary:hover,.cu-send:hover:not(:disabled) {background: #e3ceff}
.cu-secondary {color: var(--cu-text); background: #27212f; border: 1px solid var(--cu-line)}
.cu-link {color: var(--cu-iris); font-size: 13px; font-weight: 540; width: fit-content; text-underline-offset: 3px}
.cu-form {margin: 0; padding: 12px 17px 15px; border-top: 1px solid #302a36; background: var(--cu-bg)}
.cu-input {display: flex; align-items: flex-end; gap: 9px; border: 1px solid #54475f; background: #221e2a; border-radius: 15px; padding: 8px 9px 8px 13px}
.cu-input:focus-within {border-color: #a286b8; box-shadow: 0 0 0 2px #d5bcff12}
.cu-input textarea {flex: 1; min-width: 0; max-height: 132px; min-height: 32px; padding: 6px 0 3px; resize: none; border: 0; outline: none; background: transparent; color: var(--cu-text); line-height: 1.42}
.cu-input textarea::placeholder {color: #a89cb3}
.cu-send {width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 0; border-radius: 50%; background: var(--cu-iris); color: #251833}
.cu-send:disabled {opacity: .58 !important}
@keyframes cu-appear {from {opacity: 0; transform: translateY(5px)} to {opacity: 1; transform: translateY(0)}}
@keyframes cu-pulse {from {opacity: .45} to {opacity: 1}}
@media (max-width: 600px) {
  .cuddle {right: max(12px,env(safe-area-inset-right)); bottom: max(12px,env(safe-area-inset-bottom))}
  .cu-panel,.cu-wide .cu-panel {position: fixed; inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top)}
  .cu-head {padding: 12px 14px}
  .cu-tool {width: 38px; height: 40px}
  .cu-tool[aria-pressed] {display: none}
  .cu-feed {padding: 16px 14px}
  .cu-start {padding: 12px 8px 24px}
  .cu-form {padding: 10px 12px max(12px,env(safe-area-inset-bottom))}
  .cu-input textarea {font-size: 16px}
}
@media (prefers-reduced-motion: reduce) {
  .cuddle *,.cuddle *::before {animation: none !important; transition: none !important; scroll-behavior: auto !important}
}
.cu-history{border:1px solid #51435e;background:#282130;color:#e9dff6;border-radius:9px;padding:6px 10px;min-height:34px;font:inherit;font-size:13px;cursor:pointer}.cu-history:hover,.cu-history-item:hover{background:#32283d;border-color:#806797}.cu-archive{overflow:auto;padding:20px;min-height:0}.cu-archive h3{margin:0 0 16px;font-size:22px;letter-spacing:-.04em}.cu-list{display:grid;gap:8px}.cu-history-item{width:100%;display:grid;gap:5px;text-align:left;background:#201b26;border:1px solid #3a3243;color:#efeaf6;border-radius:12px;padding:12px 14px;font:inherit;cursor:pointer}.cu-history-item[aria-current]{border-color:#9471b3}.cu-history-item strong{font-weight:550;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cu-history-item small{color:#b8aabe}.cu-thread .cu-card:has(.cu-primary){border-inline-start:3px solid #ac87cf}.cu-thread .cu-user{overflow-wrap:anywhere}.cu-head .cu-heading{min-width:0}.cu-head .cu-context{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.cu-feed,.cu-archive{overscroll-behavior:contain;scrollbar-gutter:stable}
.cu-list .cu-history-item{min-height:62px}
.cu-input:focus-within{border-color:#ae8fcb;box-shadow:0 0 0 2px #a77ace20}
@media(prefers-reduced-motion:no-preference){
  .cu-history-item,.cu-input,.cu-choice,.cu-tool,.cu-send{transition:background-color 130ms ease,border-color 130ms ease,box-shadow 130ms ease}
  .cu-archive:not([hidden]){animation:cu-appear 140ms ease-out}
  .cu-send:active:not(:disabled),.cu-starter:active{transform:translateY(1px)}
}
