:root {
  --bg: #11110f;
  --panel: #191916;
  --panel-2: #23231f;
  --line: #3a3831;
  --line-strong: #5a554b;
  --text: #f2eee3;
  --muted: #aaa395;
  --faint: #756f64;
  --accent: #d98255;
  --accent-2: #f2c690;
  --danger: #d86d6d;
  --user: #2c2b27;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

button,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 43vw) minmax(0, 1fr);
}

.cover {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #050504;
}

.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% center;
  opacity: 0.92;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.72)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08), rgba(17, 17, 15, 0.42));
}

.cover-copy {
  position: absolute;
  left: clamp(24px, 5vw, 64px);
  right: clamp(24px, 5vw, 64px);
  bottom: clamp(30px, 7vw, 72px);
  z-index: 1;
}

.mark {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  max-width: 9ch;
  font-size: clamp(4rem, 8vw, 7.4rem);
  line-height: 0.86;
}

.cover-copy h1 {
  max-width: 13ch;
  font-size: clamp(2.35rem, 4.6vw, 4.65rem);
  line-height: 0.98;
}

.tagline {
  max-width: 480px;
  margin: 22px 0 0;
  color: #d8d0c1;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.72rem);
  line-height: 1.22;
}

.chat-shell {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(217, 130, 85, 0.1), transparent 34%),
    var(--bg);
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.identity img,
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 34%;
  border: 1px solid var(--line-strong);
}

.identity p {
  margin: 0;
  font-weight: 850;
}

.identity span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.credits {
  min-width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-2);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  font-weight: 760;
}

.messages {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 10px 2px 6px;
  scrollbar-color: var(--line-strong) transparent;
}

.message {
  max-width: 760px;
  display: grid;
  gap: 10px;
}

.user-message {
  align-self: flex-end;
  max-width: min(680px, 86%);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--user);
  color: #e8e1d5;
}

.vicenta-message {
  grid-template-columns: 42px minmax(0, 1fr);
  align-self: flex-start;
}

.message-body {
  padding: 0 0 0 16px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.16rem, 1.75vw, 1.48rem);
  line-height: 1.45;
  white-space: pre-wrap;
}

.message-body p,
.user-message p {
  margin: 0;
}

.message-body p + p {
  margin-top: 12px;
}

.notice {
  display: inline-block;
  margin: 0 0 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(217, 130, 85, 0.14);
  color: #f3bd9f;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 760;
}

.quick-modes,
.after-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-modes button,
.after-actions button,
.ghost-button,
.send-button,
.paywall-actions button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-weight: 720;
}

.quick-modes button:hover,
.after-actions button:hover,
.ghost-button:hover {
  border-color: var(--line-strong);
  background: #2b2a26;
}

.quick-modes button.is-active {
  border-color: rgba(217, 130, 85, 0.72);
  color: #fff4e8;
  background: rgba(217, 130, 85, 0.16);
}

.composer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.composer-head {
  min-height: 44px;
  padding: 13px 16px 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
}

.composer-head label {
  font-weight: 760;
}

#counter {
  color: var(--faint);
  font-size: 0.84rem;
  white-space: nowrap;
}

textarea {
  width: 100%;
  min-height: 130px;
  padding: 12px 16px;
  border: 0;
  resize: vertical;
  outline: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.45;
}

textarea::placeholder {
  color: #777166;
}

.composer-actions {
  min-height: 52px;
  padding: 0 12px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

select {
  width: 116px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: var(--panel-2);
}

.send-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #1b100b;
}

.send-button:hover {
  background: #ee956d;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.safety-note {
  margin: 0;
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.4;
}

.footer-note {
  display: grid;
  gap: 8px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-links a,
.back-link {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.legal-links a:hover,
.back-link:hover {
  color: var(--accent-2);
}

.legal-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(217, 130, 85, 0.12), transparent 34%),
    var(--bg);
}

.legal-page {
  width: min(100% - 32px, 820px);
  margin: 0 auto;
  padding: clamp(32px, 7vw, 72px) 0;
}

.legal-page h1 {
  max-width: none;
  margin-bottom: 20px;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.92;
}

.legal-page h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.legal-page section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.legal-page p {
  margin: 0 0 10px;
  color: #d8d0c1;
  line-height: 1.6;
}

.legal-warning {
  max-width: 680px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 130, 85, 0.42);
  border-radius: 8px;
  background: rgba(217, 130, 85, 0.1);
}

.paywall {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}

.paywall[hidden],
.after-actions[hidden] {
  display: none !important;
}

.paywall-box {
  width: min(100%, 420px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 24px;
  background: #1c1b18;
  box-shadow: var(--shadow);
}

.paywall-box h2 {
  font-size: 2rem;
}

.paywall-box p {
  color: var(--muted);
  line-height: 1.45;
}

.paywall-actions {
  display: flex;
  gap: 10px;
}

.paywall-actions button:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: #1b100b;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .cover {
    min-height: 42vh;
  }

  .cover-copy {
    bottom: 28px;
  }

  h1 {
    max-width: 10ch;
    font-size: clamp(3.4rem, 16vw, 6rem);
  }

  .cover-copy h1 {
    max-width: 15ch;
    font-size: clamp(2.15rem, 8.5vw, 4rem);
  }

  .tagline {
    max-width: 620px;
  }

  .chat-shell {
    min-height: 58vh;
  }
}

@media (max-width: 620px) {
  .chat-shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .identity span {
    display: none;
  }

  .credits {
    min-width: 78px;
    font-size: 0.86rem;
  }

  .quick-modes button,
  .after-actions button {
    flex: 1 1 calc(50% - 8px);
  }

  .composer-head,
  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  select,
  .ghost-button,
  .send-button {
    width: 100%;
  }

  .vicenta-message {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .identity img,
  .avatar {
    width: 34px;
    height: 34px;
  }

  .message-body {
    padding-left: 12px;
  }

  .cover-copy h1 {
    max-width: 15ch;
    font-size: clamp(2rem, 9vw, 3.15rem);
  }
}
