.lune-backdrop {
  position: fixed;
  inset: 0;
  z-index: 41;
  padding: 0;
  background: rgba(39, 23, 28, 0.13);
  border: 0;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(3px) saturate(90%);
  transition: opacity 220ms ease;
}

.lune-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lune-panel {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 42;
  display: grid;
  width: min(29rem, calc(100vw - 1.5rem));
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--color-text);
  background:
    radial-gradient(circle at 100% 0, rgba(233, 72, 91, 0.085), transparent 20rem),
    rgba(255, 253, 253, 0.985);
  border: 1px solid rgba(77, 32, 40, 0.085);
  border-radius: 1.4rem;
  box-shadow: -1.2rem 1.4rem 4.5rem rgba(58, 28, 35, 0.17), inset 0 1px rgba(255, 255, 255, 0.92);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 1.25rem)) scale(0.985);
  transform-origin: right center;
  transition:
    width 520ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 420ms ease,
    box-shadow 420ms ease,
    opacity 180ms ease,
    transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lune-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.lune-panel.is-expanded {
  width: calc(100vw - 1.5rem);
  border-radius: 1.15rem;
  box-shadow: 0 1.8rem 5.5rem rgba(58, 28, 35, 0.2), inset 0 1px rgba(255, 255, 255, 0.92);
}

.lune-panel__header {
  display: flex;
  min-height: 4.4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.95rem 0.8rem 1.1rem;
  border-bottom: 1px solid rgba(77, 32, 40, 0.065);
}

.lune-panel__identity,
.lune-panel__actions {
  display: flex;
  align-items: center;
}

.lune-panel__identity {
  min-width: 0;
  gap: 0.65rem;
}

.lune-panel__mark {
  position: relative;
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 auto;
  place-items: center;
  background: conic-gradient(from 24deg, #941a32, #e13e57 35%, #ff9185 57%, #f5c0b8 72%, #b42b43 100%);
  border-radius: 50%;
  box-shadow: 0 0.35rem 1rem rgba(180, 43, 67, 0.2);
}

.lune-panel__mark::after {
  position: absolute;
  inset: 0.25rem;
  content: "";
  background: #fffafa;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.82);
}

.lune-panel__identity h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.lune-panel__actions {
  gap: 0.22rem;
}

.lune-panel__icon-button,
.lune-send,
.lune-copy,
.lune-history__new,
.lune-history-item__select,
.lune-history-item__delete {
  border: 0;
  cursor: pointer;
}

.lune-response code {
  padding: 0.12rem 0.3rem;
  background: rgba(77, 32, 40, 0.06);
  border-radius: 0.3rem;
  font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace;
}

.lune-response a {
  color: #9f2340;
  font-weight: 630;
  text-underline-offset: 0.16em;
}

.lune-response em { color: #66565a; }
.lune-response s { color: var(--color-text-muted); }

.lune-response ul {
  display: grid;
  gap: 0.5rem;
  margin: 0.9rem 0;
  padding-left: 1.3rem;
}

.lune-response h4 {
  margin: 0.95rem 0 0.35rem;
  font-size: 0.82rem;
}

.lune-response h2,
.lune-response h3 {
  margin: 1.5rem 0 0.55rem;
  color: #382a2e;
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.lune-response h3 { font-size: 0.98rem; }

.lune-response blockquote {
  margin: 0.8rem 0;
  padding: 0.65rem 0.8rem;
  color: #66565a;
  background: rgba(247, 239, 241, 0.65);
  border-left: 0.2rem solid rgba(190, 42, 71, 0.45);
  border-radius: 0 0.65rem 0.65rem 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.lune-response hr {
  height: 1px;
  margin: 1.1rem 0;
  background: rgba(77, 32, 40, 0.09);
  border: 0;
}

.lune-mention {
  padding: 0.08rem 0.28rem;
  color: #92233e;
  background: rgba(213, 54, 83, 0.09);
  border-radius: 0.34rem;
  font-weight: 680;
}

.lune-inline-image {
  display: block;
  width: min(100%, 38rem);
  max-height: 28rem;
  margin: 0.7rem 0;
  object-fit: contain;
  background: #f7f1f2;
  border: 1px solid rgba(77, 32, 40, 0.08);
  border-radius: 0.85rem;
}

.lune-table-wrap {
  margin: 0.85rem 0;
  overflow-x: auto;
  border: 1px solid rgba(77, 32, 40, 0.08);
  border-radius: 0.8rem;
}

.lune-table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.lune-table-wrap th,
.lune-table-wrap td { padding: 0.62rem 0.7rem; border-bottom: 1px solid rgba(77, 32, 40, 0.065); text-align: left; vertical-align: top; }
.lune-table-wrap th { color: #61454c; background: rgba(248, 241, 243, 0.84); font-size: 0.68rem; font-weight: 740; }
.lune-table-wrap tbody tr:last-child td { border-bottom: 0; }

.lune-code-wrap {
  position: relative;
  margin: 0.8rem 0;
  padding-top: 2rem;
  overflow: hidden;
  background: #2b2527;
  border: 1px solid rgba(37, 24, 28, 0.2);
  border-radius: 0.82rem;
}

.lune-code-wrap > span { position: absolute; top: 0.58rem; left: 0.75rem; color: #c8b8bc; font: 0.64rem ui-monospace, monospace; text-transform: uppercase; }
.lune-code-wrap > button { position: absolute; top: 0.35rem; right: 0.4rem; padding: 0.3rem 0.48rem; color: #e8dfe1; background: rgba(255,255,255,.08); border: 0; border-radius: .4rem; cursor: pointer; font-size: .62rem; }
.lune-code { max-height: 24rem; margin: 0; padding: 0.8rem; overflow: auto; color: #f7eef0; background: transparent; font: 0.72rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.lune-code code { padding: 0; color: inherit; background: transparent; }

.lune-html-preview {
  position: relative;
  margin: 1.25rem 0 0.4rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(77, 32, 40, 0.085);
  border-radius: 1.15rem;
  box-shadow: 0 1rem 2.8rem rgba(77, 32, 40, 0.075);
}

.lune-html-preview > figcaption { display: flex; min-height: 3.35rem; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem .72rem .65rem 1rem; color: #5f4b50; background: linear-gradient(180deg, #fff, #fcf8f9); border-bottom: 1px solid rgba(77,32,40,.065); }
.lune-html-preview > figcaption span { display: grid; gap: .1rem; }
.lune-html-preview > figcaption strong { font-size: .75rem; font-weight: 720; }
.lune-html-preview > figcaption small { color: var(--color-text-muted); font-size: .62rem; font-weight: 560; }
.lune-html-preview > figcaption button { padding: .42rem .62rem; color: #81223a; background: #fff; border: 1px solid rgba(142,41,64,.11); border-radius: .58rem; cursor: pointer; font-size: .64rem; font-weight: 680; transition: background 150ms ease, transform 150ms ease; }
.lune-html-preview > figcaption button:hover { background: #fff7f8; transform: translateY(-1px); }
.lune-html-preview iframe { display: block; width: 100%; height: 22rem; background: #fff; border: 0; transition: height 220ms ease; }
.lune-html-preview.is-expanded { position: fixed; inset: 1.4rem; z-index: 50; display: grid; grid-template-rows: auto minmax(0, 1fr); margin: 0; }
.lune-html-preview.is-expanded iframe { height: 100%; }

.lune-chart { margin: .85rem 0; padding: .8rem; background: linear-gradient(145deg, #fff, #fbf6f7); border: 1px solid rgba(77,32,40,.08); border-radius: .85rem; }
.lune-chart figcaption { margin-bottom: .75rem; color: #49373c; font-size: .75rem; font-weight: 730; }
.lune-bar-chart { display: flex; height: 12rem; gap: .5rem; align-items: end; padding-top: 1rem; }
.lune-bar-chart > div { position: relative; display: flex; min-width: 1.8rem; height: 100%; flex: 1; align-items: center; justify-content: end; flex-direction: column; }
.lune-bar-chart > div > span { width: min(2.4rem, 78%); min-height: .2rem; background: var(--chart-color); border-radius: .35rem .35rem .12rem .12rem; box-shadow: 0 .35rem .7rem color-mix(in srgb, var(--chart-color) 20%, transparent); }
.lune-bar-chart small { width: 100%; margin-top: .35rem; overflow: hidden; color: var(--color-text-secondary); font-size: .58rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.lune-bar-chart b { position: absolute; top: -.2rem; color: #5d484e; font-size: .62rem; }
.lune-line-chart { width: 100%; height: 11rem; overflow: visible; }
.lune-line-chart polyline { fill: none; stroke: #c52f4d; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.lune-chart-labels { display: flex; justify-content: space-between; gap: .3rem; color: var(--color-text-secondary); font-size: .57rem; }
.lune-donut { display: grid; grid-template-columns: 8rem minmax(0,1fr); gap: 1rem; align-items: center; }
.lune-donut > i { width: 8rem; height: 8rem; border: 1.35rem solid #fff; border-radius: 50%; box-shadow: 0 .4rem 1rem rgba(77,32,40,.09); }
.lune-donut ul { margin: 0; padding: 0; list-style: none; }
.lune-donut li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .4rem; align-items: center; font-size: .66rem; }
.lune-donut li > span { width: .5rem; height: .5rem; background: var(--chart-color); border-radius: 50%; }

.lune-generated-image { margin: 1.25rem 0 .4rem; overflow: hidden; background: #f8f2f3; border: 1px solid rgba(77,32,40,.085); border-radius: 1.15rem; box-shadow: 0 1rem 2.8rem rgba(77,32,40,.075); }
.lune-generated-image > a { display: block; background: linear-gradient(145deg, #fbf4f6, #f5eff7); }
.lune-generated-image img { display: block; width: 100%; max-height: 40rem; object-fit: contain; }
.lune-generated-image figcaption { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem .85rem; color: #66545a; background: #fff; border-top: 1px solid rgba(77,32,40,.065); font-size: .64rem; font-weight: 650; }
.lune-generated-image figcaption a { color: #8e2940; text-decoration: none; }

.lune-send.is-stop {
  color: #a5223d;
  background: rgba(203, 41, 73, 0.1);
}

.lune-panel__icon-button {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  padding: 0;
  color: var(--color-text-secondary);
  background: transparent;
  border-radius: 0.75rem;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.lune-panel__icon-button:hover,
.lune-panel__icon-button:focus-visible {
  color: var(--color-text);
  background: rgba(77, 32, 40, 0.055);
  outline: 0;
}

.lune-panel__icon-button:active {
  transform: scale(0.96);
}

.lune-panel__icon-button .icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 1.7;
}

.lune-panel__body {
  display: grid;
  min-height: 0;
  grid-template-columns: 0 minmax(0, 1fr);
  transition: grid-template-columns 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lune-panel.is-expanded .lune-panel__body {
  grid-template-columns: 17.5rem minmax(0, 1fr);
}

.lune-history {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(251, 246, 247, 0.92), rgba(248, 242, 244, 0.72)),
    #fbf8f9;
  border-right: 1px solid rgba(77, 32, 40, 0.065);
  opacity: 0;
  transform: translateX(-1rem);
  transition: opacity 240ms ease 80ms, transform 420ms cubic-bezier(0.22, 1, 0.36, 1) 60ms;
}

.lune-panel.is-expanded .lune-history {
  opacity: 1;
  transform: translateX(0);
}

.lune-history__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1rem 0.8rem 1.15rem;
}

.lune-history__header h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 710;
  letter-spacing: -0.015em;
}

.lune-history__new {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  padding: 0;
  color: #8e2940;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(155, 37, 59, 0.09);
  border-radius: 50%;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.lune-history__new:hover,
.lune-history__new:focus-visible {
  background: #fff;
  border-color: rgba(155, 37, 59, 0.16);
  outline: 0;
  transform: translateY(-1px);
}

.lune-history__new .icon {
  width: 0.9rem;
  height: 0.9rem;
}

.lune-history__list {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  gap: 0.3rem;
  align-content: start;
  padding: 0.25rem 0.7rem 1rem;
  overflow-y: auto;
}

.lune-history-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.lune-history-item:hover,
.lune-history-item:focus-within {
  background: rgba(255, 255, 255, 0.62);
}

.lune-history-item.is-active {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(155, 37, 59, 0.08);
  box-shadow: 0 0.45rem 1.1rem rgba(77, 32, 40, 0.045);
}

.lune-history-item__select {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.62rem;
  align-items: center;
  padding: 0.72rem 0.45rem 0.72rem 0.72rem;
  color: var(--color-text);
  background: transparent;
  text-align: left;
}

.lune-history-item__select:focus-visible {
  outline: 0;
}

.lune-history-item__mark {
  width: 0.5rem;
  height: 0.5rem;
  background: rgba(145, 116, 123, 0.5);
  border-radius: 50%;
}

.lune-history-item.is-active .lune-history-item__mark {
  background: #d63251;
  box-shadow: 0 0 0 0.2rem rgba(214, 50, 81, 0.09);
}

.lune-history-item__copy,
.lune-history-item__copy strong {
  display: block;
  min-width: 0;
}

.lune-history-item__copy strong {
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lune-history-item__delete {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  margin-right: 0.36rem;
  padding: 0;
  color: var(--color-text-muted);
  background: transparent;
  border-radius: 0.55rem;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: color 150ms ease, background 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.lune-history-item:hover .lune-history-item__delete,
.lune-history-item:focus-within .lune-history-item__delete {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.lune-history-item__delete:hover,
.lune-history-item__delete:focus-visible {
  color: #b62947;
  background: rgba(214, 50, 81, 0.07);
  outline: 0;
}

.lune-history-item__delete .icon {
  width: 0.82rem;
  height: 0.82rem;
}

.lune-conversation {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 76% 0, rgba(234, 77, 97, 0.045), transparent 24rem),
    rgba(255, 253, 253, 0.76);
}

.lune-thread {
  min-height: 0;
  padding: 0.95rem 1rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(117, 100, 104, 0.2) transparent;
  scrollbar-width: thin;
}

.lune-panel.is-expanded .lune-thread {
  padding: 1.75rem clamp(1.5rem, 3.5vw, 4.5rem) 3rem;
}

.lune-panel.is-expanded .lune-thread > * {
  width: 100%;
  max-width: none;
}

.lune-thread__intro {
  margin: 0.35rem 0 1.4rem;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 620;
  text-align: center;
}

.lune-message {
  display: flex;
  width: 100%;
  margin-top: 1.45rem;
}

.lune-message--user {
  justify-content: flex-end;
}

.lune-message--user > div {
  display: grid;
  max-width: min(70%, 37rem);
  gap: .35rem;
  justify-items: end;
}

.lune-message--user img {
  width: min(13rem, 100%);
  max-height: 13rem;
  object-fit: cover;
  border: 1px solid rgba(215,47,72,.11);
  border-radius: .9rem;
}

.lune-message--user p {
  max-width: 100%;
  margin: 0;
  padding: 0.8rem 1rem;
  color: #542f38;
  background: linear-gradient(135deg, rgba(255, 245, 246, 0.98), rgba(249, 229, 233, 0.88));
  border: 1px solid rgba(215, 47, 72, 0.11);
  border-radius: 1rem 0.34rem 1rem 1rem;
  box-shadow: 0 0.6rem 1.5rem rgba(148, 35, 55, 0.05);
  font-size: 0.86rem;
  line-height: 1.55;
}

.lune-message--assistant {
  display: block;
}

.lune-response {
  position: relative;
  max-width: 64rem;
  padding: 0.25rem 0.4rem 0.25rem 1.65rem;
}

.lune-response::before {
  position: absolute;
  top: 0.66rem;
  left: 0.15rem;
  width: 0.56rem;
  height: 0.56rem;
  content: "";
  background: conic-gradient(from 25deg, #a41f3a, #ed5067 40%, #ff9a88 68%, #a41f3a);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 0 0.18rem rgba(211, 51, 80, 0.08), 0 0.3rem 0.7rem rgba(177, 33, 60, 0.12);
}

.lune-response.is-thinking {
  min-height: 1.65rem;
}

.lune-response.is-thinking::before {
  animation: lune-response-thinking 1.25s cubic-bezier(.45, 0, .55, 1) infinite;
}

@keyframes lune-response-thinking {
  0%, 100% {
    opacity: .5;
    transform: scale(.78);
    box-shadow: 0 0 0 .12rem rgba(211, 51, 80, .06), 0 .2rem .55rem rgba(177, 33, 60, .1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 0 0 .28rem rgba(211, 51, 80, .09), 0 .35rem .85rem rgba(177, 33, 60, .2);
  }
}

.lune-response > p {
  margin: 0;
  color: #4e4144;
  font-size: 0.91rem;
  line-height: 1.7;
}

.lune-response > p + p {
  margin-top: 0.7rem;
}

.lune-focus-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.lune-focus-item {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.72rem;
  align-items: center;
  padding: 0.7rem 0.78rem;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(77, 32, 40, 0.06);
  border-radius: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.lune-focus-item:hover,
.lune-focus-item:focus-visible {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(215, 47, 72, 0.12);
  box-shadow: 0 0.4rem 1rem rgba(77, 32, 40, 0.05);
  outline: 0;
  transform: translateY(-1px);
}

.lune-focus-item__mark {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  background: #9b72bc;
  border-radius: 50%;
  box-shadow: 0 0 0 0.2rem rgba(155, 114, 188, 0.1);
}

.lune-focus-item--revision .lune-focus-item__mark {
  background: #d17a4c;
  box-shadow: 0 0 0 0.2rem rgba(209, 122, 76, 0.1);
}

.lune-focus-item--request .lune-focus-item__mark {
  background: #4687b5;
  box-shadow: 0 0 0 0.2rem rgba(70, 135, 181, 0.1);
}

.lune-focus-item strong,
.lune-focus-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lune-focus-item strong {
  font-size: 0.78rem;
  font-weight: 680;
}

.lune-focus-item small {
  margin-top: 0.12rem;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 560;
}

.lune-draft {
  position: relative;
  margin-top: 0.75rem;
  padding: 0.8rem 2.5rem 0.8rem 0.85rem;
  color: #584a4d;
  background: rgba(247, 239, 241, 0.72);
  border: 1px solid rgba(77, 32, 40, 0.06);
  border-radius: 0.78rem;
  font-size: 0.79rem;
  line-height: 1.5;
}

.lune-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  padding: 0;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 0.58rem;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.lune-copy:hover,
.lune-copy:focus-visible,
.lune-copy.is-copied {
  color: #b22d49;
  background: #fff;
  outline: 0;
}

.lune-copy:active {
  transform: scale(0.94);
}

.lune-copy .icon {
  width: 0.86rem;
  height: 0.86rem;
}

.lune-composer-wrap {
  padding: 0.8rem;
  background: linear-gradient(180deg, rgba(255, 253, 253, 0), rgba(255, 253, 253, 0.98) 24%);
}

.lune-panel.is-expanded .lune-composer-wrap {
  display: flex;
  flex-direction: column;
  padding: 1.1rem clamp(1.5rem, 3.5vw, 4.5rem) 1.25rem;
}

.lune-composer {
  display: grid;
  width: 100%;
  min-height: 3.9rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0.52rem 0.58rem 0.52rem 1rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(77, 32, 40, 0.09);
  border-radius: 1rem;
  box-shadow: 0 0.65rem 1.8rem rgba(77, 32, 40, 0.075), inset 0 1px rgba(255, 255, 255, 0.9);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.lune-panel.is-expanded .lune-composer {
  max-width: 72rem;
  margin: 0;
}

.lune-composer:focus-within {
  border-color: rgba(215, 47, 72, 0.18);
  box-shadow: 0 0.8rem 2rem rgba(155, 37, 59, 0.09), 0 0 0 0.2rem rgba(215, 47, 72, 0.03);
}

.lune-composer textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  max-height: 8rem;
  resize: none;
  padding: 0.75rem 0 0.58rem;
  color: var(--color-text);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.42;
}

.lune-composer textarea::placeholder {
  color: var(--color-text-muted);
}

.lune-send {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  padding: 0;
  color: #fff;
  background: linear-gradient(145deg, #df3855, #b81536);
  border-radius: 0.82rem;
  box-shadow: 0 0.5rem 1.15rem rgba(173, 23, 51, 0.2), inset 0 1px rgba(255, 255, 255, 0.24);
  transition: box-shadow 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.lune-send:hover,
.lune-send:focus-visible {
  box-shadow: 0 0.65rem 1.35rem rgba(173, 23, 51, 0.27), inset 0 1px rgba(255, 255, 255, 0.28);
  outline: 0;
  transform: translateY(-1px);
}

.lune-send:disabled {
  cursor: default;
  opacity: 0.46;
  box-shadow: none;
  transform: none;
}

.lune-send .icon {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 46rem) {
  .lune-panel,
  .lune-panel.is-expanded {
    inset: 0.5rem;
    width: auto;
    border-radius: 1.15rem;
  }

  .lune-panel.is-expanded .lune-panel__body {
    grid-template-columns: 12.5rem minmax(0, 1fr);
  }

  .lune-panel.is-expanded .lune-thread,
  .lune-panel.is-expanded .lune-composer-wrap {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (max-width: 34rem) {
  .lune-panel.is-expanded .lune-panel__body {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .lune-panel.is-expanded .lune-history {
    opacity: 0;
    pointer-events: none;
  }

  .lune-message--user > div {
    max-width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lune-panel,
  .lune-panel__body,
  .lune-history,
  .lune-backdrop {
    transition-duration: 0.01ms;
  }

  .lune-response.is-thinking::before {
    animation: none;
  }
}
.lune-usage {
  --lune-remaining: 100%;
  display: none;
  width: auto;
  margin: auto 1.15rem 1.25rem;
}

.lune-panel.is-expanded .lune-usage:not([hidden]) {
  display: block;
}

.lune-usage__track {
  display: block;
  width: 100%;
  height: .2rem;
  overflow: hidden;
  background: rgba(106, 73, 81, .1);
  border-radius: 999px;
}

.lune-usage__track i {
  display: block;
  width: var(--lune-remaining);
  height: 100%;
  background: linear-gradient(90deg, #ec918e, #d43a56 72%, #b92543);
  border-radius: inherit;
  transition: width 420ms cubic-bezier(.22, 1, .36, 1);
}
.lune-image-previews { display: flex; gap: .5rem; padding: 0 .25rem .5rem; }
.lune-image-previews:empty { display: none; }
.lune-image-previews span { position: relative; display: block; }
.lune-image-previews img { width: 3.25rem; height: 3.25rem; object-fit: cover; border-radius: .65rem; }
.lune-image-previews button { position: absolute; top: -.35rem; right: -.35rem; width: 1.25rem; height: 1.25rem; padding: 0; color: white; background: #782239; border: 0; border-radius: 50%; }
.lune-attach { display: grid; width: 2.3rem; height: 2.3rem; flex: 0 0 auto; place-items: center; padding: 0; color: var(--color-text-secondary); background: transparent; border: 0; border-radius: .7rem; cursor: pointer; }
.lune-attach .icon { width: 1rem; height: 1rem; }
.lune-action-card {
  margin-top: 1.25rem;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(253, 247, 248, 0.97));
  border: 1px solid rgba(142, 41, 64, 0.13);
  border-radius: 1.2rem;
  box-shadow: 0 0.9rem 2.6rem rgba(77, 32, 40, 0.08), inset 0 1px rgba(255, 255, 255, 0.92);
}

.lune-action-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.3rem 0;
}

.lune-action-card__kicker,
.lune-action-card__status {
  color: #8c626c;
  font-size: 0.875rem;
  font-weight: 690;
}

.lune-action-card__status {
  padding: 0.38rem 0.6rem;
  color: #56766d;
  background: rgba(73, 145, 125, 0.09);
  border-radius: 999px;
}

.lune-action-card--dismissed .lune-action-card__status,
.lune-action-card--unavailable .lune-action-card__status {
  color: #786d70;
  background: rgba(91, 72, 77, 0.07);
}

.lune-action-card__body { padding: 0.9rem 1.3rem 1.4rem; }

.lune-action-card__body h3 {
  margin: 0;
  color: #33272a;
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.lune-action-card__body p {
  display: -webkit-box;
  max-width: 42rem;
  margin: 0.75rem 0 0;
  overflow: hidden;
  color: #66565a;
  font-size: 0.95rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.lune-action-card__body small {
  display: block;
  margin-top: 0.75rem;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.lune-action-card__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  padding: 1rem 1.15rem 1.1rem;
  background: rgba(250, 244, 246, 0.62);
  border-top: 1px solid rgba(77, 32, 40, 0.07);
}

.lune-action-card__footer button {
  min-height: 2.9rem;
  padding: 0.75rem 1.1rem;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 720;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.lune-action-card__dismiss {
  color: #6b585e;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(77, 32, 40, 0.1);
}

.lune-action-card__confirm {
  color: #fff;
  background: linear-gradient(145deg, #cb3150, #a9213e);
  border: 1px solid transparent;
  box-shadow: 0 0.48rem 1.1rem rgba(164, 31, 60, 0.19);
}

.lune-action-card__footer button:hover,
.lune-action-card__footer button:focus-visible {
  outline: 0;
  transform: translateY(-1px);
}

.lune-action-card__dismiss:hover,
.lune-action-card__dismiss:focus-visible { background: #fff; border-color: rgba(77, 32, 40, 0.18); }
.lune-action-card__confirm:hover,
.lune-action-card__confirm:focus-visible { box-shadow: 0 0.7rem 1.4rem rgba(164, 31, 60, 0.26); }
