@import url("auth.css");

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .grid {
    grid-template-columns: 340px 1fr;
    align-items: start;
  }
}
.panel h2 {
  font-family: Manrope, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.stat {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stat strong { color: var(--ink); font-weight: 600; }
.token-box {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  border-radius: 2px;
  margin: 0.5rem 0 0.75rem;
}
.plan-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.15);
}
.plan-row .meta { font-size: 0.85rem; }
.plan-row .meta small { display: block; color: var(--muted); margin-top: 0.15rem; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Chat Lite — thread + composer */
.chat-panel { display: flex; flex-direction: column; }

.thread {
  min-height: 260px;
  max-height: 56vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.25rem;
  margin-bottom: 0.85rem;
}
.thread .empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  max-width: 360px;
}
.thread .empty p { font-size: 0.92rem; }
.thread .empty-sub { font-size: 0.82rem; margin-top: 0.35rem; opacity: 0.85; }

.msg { display: flex; flex-direction: column; max-width: 92%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; width: 100%; }
.bubble {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .bubble {
  background: rgba(27, 122, 92, 0.1);
  border: 1px solid var(--line);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  border-bottom-right-radius: 3px;
}
.msg.assistant .bubble {
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom-left-radius: 3px;
  width: 100%;
}
.msg-row { display: flex; gap: 0.55rem; align-items: flex-start; width: 100%; }
.avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: block;
  object-fit: cover;
}
.who { font-family: Manrope, sans-serif; font-weight: 700; font-size: 0.8rem; margin-bottom: 0.3rem; }
.who time { color: var(--muted); font-weight: 500; font-size: 0.72rem; margin-left: 0.4rem; }
.answer { white-space: pre-wrap; }

.details {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel, #fff);
  overflow: hidden;
}
.details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: 0.83rem;
}
.details > summary::-webkit-details-marker { display: none; }
.details > summary::after {
  content: "⌄";
  margin-left: auto;
  color: var(--muted);
  font-size: 1rem;
  transition: transform 0.15s;
}
.details[open] > summary::after { transform: rotate(180deg); }
.details .tick {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
}
.details-body { padding: 0 0.85rem 0.75rem; }
.details-body h4 {
  font-family: Manrope, sans-serif;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.65rem 0 0.3rem;
}
.details-body ul { list-style: none; display: grid; gap: 0.28rem; }
.details-body li { font-size: 0.83rem; padding-left: 0.85rem; position: relative; }
.details-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.meta-badges {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.meta-badges .hitl {
  color: #fff;
  background: var(--warn, #8a6a3a);
  padding: 0.1rem 0.4rem;
  font-weight: 700;
  border-radius: 999px;
}

.composer {
  border: 1px solid var(--line);
  background: var(--panel, #fff);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.composer textarea {
  width: 100%;
  min-height: 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  max-height: 200px;
}
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.composer-hint { color: var(--muted); font-size: 0.74rem; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  background: rgba(61, 186, 138, 0.15);
  color: var(--accent);
  margin-left: 0.35rem;
}
.badge.warn { background: rgba(196, 165, 116, 0.18); color: var(--warn); }
.muted { color: var(--muted); font-size: 0.85rem; }
.note {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--warn, #c4a574);
  color: var(--muted);
  font-size: 0.9rem;
  border-radius: 2px;
}
.actions-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
