/* ── Shares panel (settings) ───────────────────────────────────────────────── */

.shares-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 2rem;
}

.share-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid oklch(var(--b3));
}

.share-list-row:last-child {
  border-bottom: none;
}

.share-list-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.share-list-title {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-list-meta {
  font-size: 0.75rem;
  color: oklch(var(--bc) / 50%);
}

.share-list-url {
  font-size: 0.7rem;
  color: oklch(var(--bc) / 40%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28ch;
}

.share-list-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.share-list-copy { color: oklch(var(--bc) / 50%); }
.share-list-copy.copied { color: oklch(var(--su)); }

/* ── Share link row ────────────────────────────────────────────────────────── */

.share-link-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.share-link-input {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid oklch(var(--b3));
  background: oklch(var(--b1));
  color: oklch(var(--bc));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-link-copy-btn {
  color: oklch(var(--bc) / 60%);
  transition: color 0.15s;
  flex-shrink: 0;
}

.share-link-copy-btn:not(:disabled):hover { color: oklch(var(--bc)); }
.share-link-copy-btn:disabled { opacity: 0.3; cursor: default; }
.share-link-copy-btn.copied { color: oklch(var(--su, 0.7 0.2 150)); }

/* ── Share toast ───────────────────────────────────────────────────────────── */

.share-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  background: oklch(var(--s));
  color: oklch(var(--sc));
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  animation: toast-in 0.15s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Share page (share.html) ───────────────────────────────────────────────── */

body.share-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  font-family: 'JetBrains Mono', monospace;
  background: oklch(var(--b1));
  color: oklch(var(--bc));
}

.share-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid oklch(var(--b3));
}

.share-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-top: 2px;
}

.share-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.share-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.share-meta {
  font-size: 0.78rem;
  color: oklch(var(--bc) / 50%);
}

.share-messages {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-bottom: 6rem;
}

.share-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-msg--user {
  align-items: flex-end;
}

.share-msg--user .share-msg-body {
  background: oklch(var(--b2));
  border-radius: 14px 14px 4px 14px;
  padding: 0.75rem 1rem;
  max-width: 85%;
  font-size: 0.9rem;
}

.share-msg--assistant .share-msg-body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: oklch(var(--bc));
}

/* ── Share page markdown typography (mirrors .msg-assistant rules) ─────────── */

.share-msg--assistant .share-msg-body p            { margin: 0 0 0.55em; }
.share-msg--assistant .share-msg-body p:last-child { margin-bottom: 0; }

.share-msg--assistant .share-msg-body h1,
.share-msg--assistant .share-msg-body h2,
.share-msg--assistant .share-msg-body h3,
.share-msg--assistant .share-msg-body h4,
.share-msg--assistant .share-msg-body h5,
.share-msg--assistant .share-msg-body h6 {
  font-weight: 600;
  margin: 0.8em 0 0.3em;
  line-height: 1.3;
}
.share-msg--assistant .share-msg-body h1 { font-size: 1.2em; }
.share-msg--assistant .share-msg-body h2 { font-size: 1.1em; }
.share-msg--assistant .share-msg-body h3 { font-size: 1.0em; }

.share-msg--assistant .share-msg-body ul,
.share-msg--assistant .share-msg-body ol {
  padding-left: 1.4em;
  margin: 0 0 0.55em;
}
.share-msg--assistant .share-msg-body ul { list-style-type: disc; }
.share-msg--assistant .share-msg-body ol { list-style-type: decimal; }
.share-msg--assistant .share-msg-body li { margin-bottom: 0.2em; }

.share-msg--assistant .share-msg-body strong { font-weight: 600; }
.share-msg--assistant .share-msg-body em     { font-style: italic; }

.share-msg--assistant .share-msg-body a {
  color: oklch(var(--p));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.share-msg--assistant .share-msg-body blockquote {
  margin: 0.4em 0;
  padding-left: 0.75em;
  border-left: 3px solid oklch(var(--p) / 35%);
  color: oklch(var(--bc) / 75%);
}

.share-msg--assistant .share-msg-body .katex-display {
  margin: 0.75em 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.share-msg--assistant .share-msg-body .katex {
  color: inherit;
  font-size: 1.05em;
}

.share-msg--assistant .share-msg-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6em 0;
  font-size: 0.9em;
  border: 1px solid oklch(var(--b3));
}
.share-msg--assistant .share-msg-body th,
.share-msg--assistant .share-msg-body td {
  padding: 0.5em 0.75em;
  text-align: left;
}
.share-msg--assistant .share-msg-body th {
  background: rgba(0,0,0,0.25);
  font-weight: 600;
}
.share-msg--assistant .share-msg-body tr:hover td {
  background: oklch(var(--b2) / 40%);
}

.share-msg--assistant .share-msg-body :not(pre) > code {
  background: oklch(var(--b3));
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', monospace;
}

.share-msg--assistant .share-msg-body pre {
  background: oklch(var(--b3));
  border-radius: 8px;
  padding: 1em;
  overflow-x: auto;
  margin: 0.6em 0;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.5;
}

.share-msg-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: oklch(var(--bc) / 40%);
  padding: 0 2px;
}

.share-error {
  text-align: center;
  color: oklch(var(--bc) / 40%);
  margin-top: 5rem;
  font-size: 0.9rem;
}
