:root {
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e0d6;
  --paper: #fffcf7;
  --panel: #ffffff;
  --rose: #e11d63;
  --rose-soft: #fce7f0;
  --teal: #0f766e;
  --ok: #15803d;
  --bg: #f3eee6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
}

code {
  font-size: 0.85em;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 360px;
  height: 100%;
}

.nav,
.sara {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  min-height: 0;
}

.sara {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 18px 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.search input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
}

.hint {
  margin: 0 0 16px;
  font-size: 11px;
  color: var(--muted);
}

.nav nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.nav a.active {
  background: var(--rose-soft);
  color: var(--rose);
  font-weight: 600;
}

.create {
  margin-top: 12px;
  border: 0;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  opacity: 0.35;
}

.you {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 16px;
}

.avatar,
.sara-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d6d3d1;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.sara-avatar {
  background: #f9a8d4;
  box-shadow: inset 0 0 0 2px #fff;
  position: relative;
}

.sara-avatar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  background: var(--ok);
  border: 2px solid #fff;
  border-radius: 50%;
}

.you span,
.persona span,
.sara header p,
.foot,
.kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stage {
  padding: 40px 48px;
  overflow: auto;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
}

.stage h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 42px;
  margin: 0 0 12px;
  font-weight: 600;
}

.lede {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.5;
}

.prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}

.prompts button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.prompts button:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.meta {
  display: flex;
  gap: 32px;
  margin: 0;
}

.meta dt {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta dd {
  margin: 4px 0 0;
  font-size: 13px;
  word-break: break-all;
}

.sara header,
.persona,
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sara h2 {
  margin: 0;
  font-size: 16px;
}

.tools button,
#send {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}

.persona {
  justify-content: flex-start;
  margin: 16px 0;
}

.thread {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thread li {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.thread li.user {
  align-self: flex-end;
  background: var(--ink);
  color: #fff;
}

.thread li.assistant {
  align-self: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.thread li .reply {
  white-space: pre-wrap;
}

.thread li.assistant.pending .reply {
  color: var(--muted);
  font-style: italic;
}

.thread .cite {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--teal);
}

.places {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
  min-width: 0;
}

.place {
  display: grid;
  gap: 4px;
  padding: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  white-space: normal;
  overflow: hidden;
  min-width: 0;
}

.place img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #eee;
}

.place strong,
.place span,
.place a {
  padding: 0 10px;
}

.place strong {
  padding-top: 8px;
}

.place a {
  color: var(--teal);
  width: max-content;
  padding-bottom: 2px;
}

#composer {
  margin-top: 12px;
}

#composer label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}

#send {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  align-self: stretch;
}

.talk {
  margin-top: 10px;
  width: 100%;
  border: 0;
  background: var(--rose);
  color: #fff;
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.talk.listening {
  background: var(--ink);
}

.foot {
  margin: 8px 0 0;
  text-align: center;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: auto;
  }

  .nav {
    display: none;
  }

  .sara {
    min-height: 70vh;
  }
}
