:root {
  font:
    16px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #152541;
  background: #f1f5fa;
  --muted: #52627a;
  --border: #dbe4ef;
  --blue: #2055ca;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
.top {
  background: #101d33;
  color: #fff;
}
.top-inner {
  max-width: 1240px;
  margin: auto;
  min-height: 72px;
  padding: 12px 26px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 700;
}
.brand-icon,
.analytics-icon {
  display: grid;
  place-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #2864dc;
  color: white;
  flex-shrink: 0;
}
.analytics-icon {
  background: #eaf1ff;
  color: #2055ca;
  font-size: 19px;
}
.connection {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
  background: #263750;
  border-radius: 20px;
  padding: 5px 11px;
  text-align: center;
}
main {
  max-width: 1240px;
  margin: auto;
  padding: 38px 26px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  letter-spacing: -0.065em;
  line-height: 1.14;
}
.intro {
  margin-bottom: 26px;
}
.intro p,
.card-head p,
.hint,
#empty {
  color: var(--muted);
}
.intro p {
  margin-top: 8px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 17px;
  overflow: hidden;
  box-shadow: 0 10px 24px #162c4910;
}
.card-head {
  padding: 18px 21px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
h2 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.card-head p,
.hint {
  font-size: 0.8rem;
}
.history {
  min-height: 240px;
  height: clamp(240px, 45vh, 520px);
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8faff;
}
.entry {
  align-self: flex-start;
  max-width: 91%;
  overflow-wrap: anywhere;
}
.entry.user {
  align-self: flex-end;
}
.entry strong {
  font-size: 0.74rem;
  display: block;
  color: var(--muted);
  margin: 0 0 4px 3px;
}
.entry p {
  white-space: pre-wrap;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px 14px 14px 14px;
  padding: 10px 13px;
}
.entry.user p {
  background: #e7efff;
  border-color: #d3e0fc;
  border-radius: 14px 4px 14px 14px;
}
.entry button {
  margin-top: 6px;
}
#composer,
.panel {
  padding: 18px 21px;
}
#composer {
  border-top: 1px solid var(--border);
}
.row {
  display: flex;
  align-items: stretch;
  gap: 9px;
}
input,
textarea,
button {
  font: inherit;
}
textarea,
input {
  border: 1px solid #acbbd0;
  border-radius: 9px;
  padding: 10px 12px;
  width: 100%;
  color: inherit;
  background: white;
}
textarea {
  min-width: 0;
  resize: vertical;
}
label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 3px;
  font-weight: 600;
}
#access {
  margin-bottom: 10px;
}
button {
  border: 0;
  border-radius: 9px;
  background: var(--blue);
  color: white;
  padding: 9px 14px;
  font-weight: 650;
  cursor: pointer;
}
button:hover:not(:disabled) {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button.secondary {
  background: #edf3ff;
  color: #214c9c;
  font-size: 0.76rem;
}
:focus-visible {
  outline: 3px solid #467ef3;
  outline-offset: 3px;
}
.hint,
#error {
  margin-top: 8px;
}
#error {
  color: #a32635;
  font-size: 0.87rem;
}
.processing {
  padding: 8px 22px;
  color: #214c9c;
  background: #f8faff;
  font-size: 0.87rem;
}
.processing span {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #5388fa;
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite alternate;
}
@keyframes pulse {
  to {
    opacity: 0.25;
  }
}
dl {
  margin: 0;
}
dt {
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  color: var(--muted);
}
dd {
  margin: 3px 0 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
dd:last-child {
  margin-bottom: 0;
}
.quote {
  padding: 9px 11px;
  background: #f2f6fc;
  border-radius: 8px;
}
.sentiment {
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 700;
  display: inline-block;
  font-size: 0.84rem;
}
.positive {
  background: #d8f5e5;
  color: #125c39;
}
.negative {
  background: #ffe4e6;
  color: #9b1f31;
}
.neutral {
  background: #e9edf3;
  color: #3e4b60;
}
.mixed {
  background: #fff1ca;
  color: #76520b;
}
@media (max-width: 760px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  main {
    padding: 27px 13px;
  }
  .top-inner {
    padding: 10px 14px;
  }
  .card-head,
  #composer,
  .panel,
  .history {
    padding-left: 14px;
    padding-right: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .processing span {
    animation: none;
  }
}
