.composer-box {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 136px;
  padding: 22px 24px 16px;
  border: 2px solid transparent;
  border-radius: 14px 14px 28px 28px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(180deg, var(--blue), #5ab7ff 18%, #5ab7ff 44%, var(--blue)) border-box;
  box-shadow: none;
  overflow: hidden;
}

.composer-box > span {
  color: var(--muted);
  font-size: 16px;
}

textarea {
  width: 100%;
  min-height: 44px;
  max-height: 112px;
  overflow: auto;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 17px;
  line-height: 1.45;
}

.composer-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.attached-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin: 4px 0 8px;
}

.template-fields {
  display: grid;
  gap: 8px;
  margin: 4px 0 10px;
}

.template-field {
  display: grid;
  gap: 6px;
  max-width: 360px;
}

.template-field span {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 850;
}

.template-field input {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid #c6dcff;
  border-radius: 14px;
  outline: 0;
  background: #f6faff;
  font-weight: 750;
}

.attached-image {
  position: relative;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid #cfe3ff;
  border-radius: 12px;
  background: #eef5ff;
}

.attached-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attached-image.pending-upload {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.attached-image.pending-upload img {
  filter: grayscale(1);
  opacity: 0.56;
}

.upload-spinner {
  position: absolute;
  inset: 15px;
  z-index: 2;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: uploadSpin 0.82s linear infinite;
  box-shadow: 0 0 0 1px rgba(15, 31, 56, 0.08);
}

.upload-progress {
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 3;
  min-width: 30px;
  padding: 2px 5px;
  color: #fff;
  border-radius: 999px;
  background: rgba(15, 31, 56, 0.74);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  transform: translateX(-50%);
}

.ready-mark {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #16a34a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.28);
}

@keyframes uploadSpin {
  to {
    transform: rotate(360deg);
  }
}

.attached-image button {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.72);
  font-size: 16px;
  line-height: 1;
}

.left-tools {
  display: inline-flex;
  gap: 14px;
}

.tool-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--blue);
  border: 0;
  background: transparent;
}

.tool-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.mic-button.is-listening {
  color: #fff;
  border-radius: 50%;
  background: var(--blue);
}

.send-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  font-size: 36px;
  line-height: 1;
}

.send-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.generation-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(135px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #dfe2f0;
  border-radius: 999px;
  background: #eceefa;
}

.mode-switch button {
  min-height: 34px;
  color: #4d566b;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 650;
}

.mode-switch button.active {
  color: var(--blue-dark);
  background: #fff;
  box-shadow: 0 8px 18px rgba(38, 54, 90, 0.08);
}

.size-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 6px 4px 16px;
  border: 1px solid #dfe2f0;
  border-radius: 999px;
  background: #fff;
}

.size-select span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.size-select select {
  min-height: 34px;
  padding: 0 24px 0 10px;
  color: var(--blue-dark);
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: #eef4ff;
  font-weight: 850;
}

.template-tabs button {
  min-height: 40px;
  padding: 0 20px;
  color: #202839;
  border: 1px solid #cfd3df;
  border-radius: 999px;
  background: #fff;
  font-weight: 650;
}

.template-tabs button.active,
.template-card:hover {
  border-color: var(--blue);
}

.templates-panel,
.account-preview {
  margin-top: 34px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading p,
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

.template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.category-hint {
  max-width: 760px;
  margin: -4px 0 18px;
  padding: 13px 16px;
  color: #31557f;
  border: 1px solid #d6e5fb;
  border-radius: 14px;
  background: #f3f8ff;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.template-empty {
  display: grid;
  grid-column: 1 / -1;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  border: 1px dashed #b7c6de;
  border-radius: 16px;
  background: #f8fbff;
  font-weight: 750;
  text-align: center;
}

.template-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 9px;
  min-height: 0;
  padding: 10px 10px 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.template-card strong {
  display: block;
  padding: 0 6px;
}

.template-card strong {
  margin-top: 2px;
  font-size: 16px;
}

.template-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 6px;
}

.template-badges span {
  width: max-content;
  padding: 4px 8px;
  color: var(--blue-dark);
  border-radius: 999px;
  background: #eef4ff;
  font-size: 11px;
  font-weight: 850;
}

.template-cover {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 0;
  border-radius: 12px;
  background:
    radial-gradient(circle at 72% 30%, rgba(255, 255, 255, 0.84), transparent 22%),
    linear-gradient(135deg, #dcecff, #fff6e8);
  background-position: center;
  background-size: cover;
}

.photo-studio {
  background:
    radial-gradient(circle at 50% 38%, #ffffff 0 16%, transparent 17%),
    linear-gradient(135deg, #dbeafe, #fef3c7);
}

.photo-social {
  background:
    radial-gradient(circle at 64% 34%, #ffc7d1 0 12%, transparent 13%),
    linear-gradient(135deg, #e0f2fe, #f5d0fe);
}

.photo-crowd {
  background:
    radial-gradient(circle at 51% 54%, rgba(32, 126, 216, 0.92) 0 13%, rgba(32, 126, 216, 0.34) 14% 23%, transparent 24%),
    repeating-conic-gradient(from 18deg at 50% 53%, rgba(23, 44, 55, 0.78) 0deg 10deg, rgba(213, 193, 159, 0.54) 10deg 19deg, rgba(15, 34, 45, 0.7) 19deg 31deg),
    linear-gradient(145deg, #102b3a, #6f8791 48%, #d7d0bc);
}

.photo-fiery { background: radial-gradient(circle at 50% 35%, #ffb36d 0 9%, transparent 10%), linear-gradient(160deg, #8c1006, #ff5a12 48%, #25070a); }
.photo-red-trail { background: linear-gradient(90deg, #2d060b, #9f1928 44%, #ff8061 72%, #4a0914); }
.photo-sunny-fisheye { background: radial-gradient(circle at 50% 42%, #ffb600 0 18%, transparent 19%), conic-gradient(from 20deg, #0c5a42, #b6df5b, #0d6a53, #d9f5a0, #0c5a42); }
.photo-mirror-shot { background: radial-gradient(ellipse at 50% 50%, #c2d5dd 0 34%, #562015 35% 46%, #1d3341 47%); }
.photo-pink-tray { background: radial-gradient(circle at 52% 48%, #f0b8c8 0 24%, #db7d9d 25% 34%, #050505 35%); }
.photo-fridge-pov { background: radial-gradient(circle at 50% 42%, #eafcff 0 24%, #78bdd0 55%, #14242d); }
.photo-night-vending { background: linear-gradient(135deg, #02070e, #0a5568 40%, #d74d40 72%, #06080d); }
.photo-paris-balcony { background: linear-gradient(145deg, #b9d4e9 0 38%, #e9d7ae 39% 63%, #85735d 64%); }
.photo-summer-city { background: linear-gradient(135deg, #77c9f5, #f7df7c 42%, #f09272 43% 68%, #4eabd5); }
.photo-rio-terrace { background: linear-gradient(150deg, #7fc6db, #bfe8d9 44%, #51a85f 45% 58%, #e86966 59%); }
.photo-rainy-departure { background: linear-gradient(135deg, #eef2f3, #aab6ba 44%, #647276 45% 70%, #d8c3bd); }
.photo-fashion-cart { background: linear-gradient(145deg, #32271f, #a68a63 42%, #6e5644 43% 64%, #1a1716); }
.photo-giant-city { background: linear-gradient(160deg, #f4d399, #d89d69 38%, #71869a 39% 67%, #233849); }
.photo-blue-silhouette { background: radial-gradient(ellipse at 50% 46%, #142a4d 0 20%, #06101d 48%, #20aee1 100%); }
.photo-floating-chess { background: conic-gradient(from 30deg at 50% 50%, #f1f0ed, #6e6d70, #eeeeed, #292a2d, #f1f0ed); }
.photo-three-d-avatar { background: radial-gradient(circle at 50% 44%, #ffd0b2 0 17%, #d18d64 18% 25%, #ffffff 26%); }
.photo-smoky-portrait { background: radial-gradient(circle at 50% 45%, #f3e6c3 0 12%, #7b8178 26%, #172326 66%, #05090a); }
