/* composer.css
   Composer only (no media queries)
*/
.composer-wrap {
  position: sticky;
  bottom: 0;
  z-index: 6;
  padding: 10px 12px calc(12px + var(--safe-bottom));

  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.72),
    rgba(255, 255, 255, 0.28)
  );

  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);

  border-top: 0;
}

.composer {
  width: min(860px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;

  /* anchor for the + menu */
  position: relative;
}

.roundbtn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.03);
  color: var(--accent);

  /* keep + vertically centered vs the growing input shell */
  align-self: center;

  /* no extra padding that can shift the glyph */
  padding: 0;
}

.roundbtn > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;

  line-height: 1;
  font-size: 26px;

  transform: none;
  transform-origin: 50% 50%;
  transition: transform 160ms ease;
}

/* toggled state */
.roundbtn.is-open > span {
  transform: rotate(45deg);
}

.input-shell {
  flex: 1;
  min-width: 0;

  border-radius: 22px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-soft);

  display: flex;
  flex-wrap: wrap; /* key: allows a full-width row above */
  align-items: flex-end;
  gap: 8px;

  padding: 10px 10px;
}

/* ===== Attachments row (ChatGPT-style: above textarea) ===== */
.attachbar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  padding: 2px 2px 6px;
  margin: 0;
}

.attachchip {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  max-width: 100%;
  padding: 8px 10px;

  border-radius: 999px;
  border: 1px solid rgba(15, 76, 129, 0.16);
  background: rgba(246, 247, 249, 0.75);
}

.attachchip .pdfico {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;

  background: rgba(220, 38, 38, 0.12); /* PDF red tint */
  color: rgba(220, 38, 38, 0.9);
}

.attachchip .pdfico svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.attachchip .name {
  max-width: min(340px, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 13px;
  color: rgba(15, 23, 42, 0.9);
}

.attachchip .x {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 0;

  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.7);

  display: grid;
  place-items: center;
  cursor: pointer;
}

.attachchip .x:hover {
  background: rgba(15, 23, 42, 0.1);
}

.attachchip .x svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* hook existing items into the grid areas */
.prompt {
  grid-area: prompt;
}
.input-actions {
  grid-area: actions;
}

.prompt {
  flex: 1;
  min-width: 0;
  resize: none;
  border: none;
  outline: none;
  padding: 2px 6px;
  font-size: 16px; /* avoids iOS zoom */
  line-height: 1.45;
  max-height: 220px;
  overflow-y: auto;

  /* Hide the scrollbar UI (the “arrow”) but keep scrolling */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* old Edge/IE */
}
.prompt::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.input-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-left: 2px;
}

.sendbtn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: #0f4c81;
  color: #fff;
  display: grid;
  place-items: center;
}
.sendbtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== + menu (Add menu) ===== */
.addmenu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);

  width: 280px;
  max-width: calc(100vw - 24px);

  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 10px;
  z-index: 20;

  /* animation (starts "closed") */
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transform-origin: left bottom;
  pointer-events: none;

  transition: opacity 160ms ease, transform 160ms ease;
}

.addmenu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.addmenu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px 10px;
  border-radius: 12px;

  border: 1px solid rgba(15, 76, 129, 0.12);
  background: rgba(246, 247, 249, 0.6);
  color: var(--text);
  text-align: left;
}

.addmenu-item:hover {
  background: rgba(15, 76, 129, 0.06);
  border-color: rgba(15, 76, 129, 0.18);
}

.addmenu-ico {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;

  background: #fff;
  border: 1px solid rgba(15, 76, 129, 0.12);
  color: rgba(15, 23, 42, 0.78);
}

.addmenu-ico svg {
  width: 18px;
  height: 18px;
}

.addmenu-title {
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: rgba(15, 23, 42, 0.58);
}

.addmenu-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.addpill {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;

  border: 1px solid rgba(15, 76, 129, 0.16);
  background: #fff;
  color: var(--text);
}

.addpill:hover {
  background: rgba(15, 76, 129, 0.06);
}

.addpill.is-active {
  background: rgba(15, 76, 129, 0.1);
  border-color: rgba(15, 76, 129, 0.22);
}
