html { font-size: 15px; }
@media (min-width: 900px) { html { font-size: 16px; } }

html, body { min-height: 100%; }
body.pi-body {
  margin: 0;
  background: #f5f5f4;
  color: #1c1917;
  font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.pi-header {
  background: #f4f4f3;
  border-bottom: 1px solid #f0efed;
}
.pi-header-inner {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 0.35rem 1.25rem 0.4rem;
  box-sizing: border-box;
}
.pi-disclaimer {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.3;
  color: #918c84;
}

.pi-main {
  flex: 1;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 2.2rem;
  box-sizing: border-box;
}

.pi-title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0c0a09;
  margin: 0 0 0.75rem 0;
}
.pi-lead {
  font-size: 1rem;
  color: #44403c;
  margin: 0 0 0.5rem 0;
}
.pi-meta {
  font-size: 0.9rem;
  color: #78716c;
  margin: 0;
}

.pi-card {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.pi-error {
  border-color: #d6d3d1;
  color: #44403c;
}
.pi-hero { margin-bottom: 1.25rem; }

.pi-chat { margin-top: 0.5rem; }
.pi-messages {
  min-height: 220px;
  max-height: 52vh;
  overflow: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.35rem 0;
  margin-bottom: 0.75rem;
}
.pi-msg {
  margin-bottom: 0.85rem;
  white-space: pre-wrap;
  max-width: 86%;
}
.pi-user {
  margin-left: auto;
  margin-right: 0.55rem;
  color: #0f172a;
  background: #e9ecf2;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}
.pi-ai {
  margin-right: auto;
  color: #1c1917;
}

.pi-composer { position: relative; }
.pi-textarea {
  width: 100%;
  min-height: 2.85rem;
  overflow-y: hidden;
  padding: 0.7rem 3.1rem 0.7rem 0.85rem;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  resize: none;
  max-width: 100%;
  line-height: 1.35;
  box-sizing: border-box;
}
.pi-textarea:focus {
  outline: none;
  border-color: #a8a29e;
  box-shadow: 0 0 0 1px #a8a29e;
}
.pi-send-btn {
  position: absolute;
  right: 0.45rem;
  bottom: 0.76rem;
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #3f5f97;
  color: #eaf1ff;
  border: none;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
}
.pi-send-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pi-send-btn:hover:not(:disabled) { background: #334f80; color: #f3f7ff; }
.pi-send-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #cbd5e1;
}
.pi-hint { font-size: 0.85rem; color: #78716c; min-height: 1.2rem; margin: 0.35rem 0 0 0; }

.d-none { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
