:root {
  --page: #fff6eb;
  --page-deep: #f4e7d8;
  --paper: rgba(255, 255, 255, 0.92);
  --paper-solid: #fffefd;
  --glass: rgba(255, 255, 255, 0.76);
  --ink: #222638;
  --ink-soft: #565a69;
  --muted: #8b8d98;
  --line: rgba(229, 211, 191, 0.76);
  --orange: #ff842b;
  --orange-dark: #bd6416;
  --gold: #eba83a;
  --mint: #33b982;
  --blue: #4f90ee;
  --rose: #ff7b73;
  --shadow-soft: 0 16px 38px rgba(115, 79, 42, 0.12);
  --shadow-card: 0 22px 50px rgba(100, 72, 41, 0.16);
  --shadow-float: 0 28px 64px rgba(92, 63, 34, 0.2);
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "HarmonyOS Sans SC", system-ui, sans-serif;
  --nav-height: 76px;
}

/* v116 inspiration page reference fidelity */
#templatesScreen.templates-screen {
  min-height: 100dvh;
  color: #3a2115;
  background: #fffaf3;
}

#templatesScreen .inspiration-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  padding: calc(12px + env(safe-area-inset-top)) max(var(--mobile-content-gutter), env(safe-area-inset-right, 0px)) 7px max(var(--mobile-content-gutter), env(safe-area-inset-left, 0px));
  background: #fff4cb;
}

#templatesScreen .inspiration-topbar .home-brand-title {
  gap: 7px;
}

#templatesScreen .inspiration-topbar .home-brand-title strong {
  color: #35180b;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: -0.8px;
}

#templatesScreen .inspiration-topbar .home-brand-title img {
  width: 23px;
  height: 23px;
}

#templatesScreen .inspiration-topbar .home-brand-lockup p {
  margin-top: 4px;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
}

#templatesScreen .inspiration-topbar .home-header-actions {
  gap: 8px;
}

#templatesScreen .inspiration-topbar .home-alert-button,
#templatesScreen .inspiration-topbar .home-avatar-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
}

#templatesScreen .inspiration-topbar .home-alert-button {
  position: relative;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#templatesScreen .inspiration-topbar .home-alert-button::after {
  position: absolute;
  top: 5px;
  right: 4px;
  width: 7px;
  height: 7px;
  content: "";
  background: #ff4f4b;
  border: 2px solid #fff4cb;
  border-radius: 50%;
}

#templatesScreen .inspiration-topbar .home-alert-button img {
  width: 27px;
  height: 27px;
}

#templatesScreen .inspiration-topbar .home-avatar-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  background: transparent;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #f0c667, 0 7px 16px rgba(101, 68, 34, 0.12);
}

#templatesScreen .template-page-content {
  display: grid;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: calc(44px + env(safe-area-inset-bottom));
  background: #fffaf3;
}

#templatesScreen .inspiration-search {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 5px 6px 5px 16px;
  background: #fff;
  border: 1px solid #ecdfd1;
  border-radius: 24px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.72), 0 9px 24px rgba(104, 72, 38, 0.08);
}

#templatesScreen .inspiration-search-icon {
  position: static;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

#templatesScreen .inspiration-search input {
  min-width: 0;
  min-height: 48px;
  padding: 0;
  color: #433126;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 16px;
  font-weight: 500;
}

#templatesScreen .inspiration-search input:focus {
  border: 0;
  box-shadow: none;
}

#templatesScreen .inspiration-search input::placeholder {
  color: var(--color-text-subtle, #7a6d64);
  opacity: 1;
}

#templatesScreen .inspiration-search input::-webkit-search-cancel-button,
#templatesScreen .inspiration-search input::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}

#templatesScreen .inspiration-search input::-ms-clear {
  display: none;
}

#templatesScreen .inspiration-search-submit {
  position: static;
  display: grid;
  place-items: center;
  width: 64px;
  height: 48px;
  padding: 0;
  background: #ffb515;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(210, 133, 15, 0.2);
  color: #3a250f;
  font-size: 13px;
  font-weight: 800;
}

#templatesScreen .inspiration-search:has(#templateSearchClear:not([hidden])) input {
  padding-right: 54px;
}

#templatesScreen #templateSearchClear {
  position: absolute;
  top: 8px;
  right: 76px;
  width: 44px;
  height: 44px;
  color: #9b4d14;
  background: transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

#templatesScreen .seedance-link-banner,
#templatesScreen .hot-copy-link-banner {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 11px;
  align-items: center;
  min-height: 68px;
  padding: 12px 13px;
  color: #3e2819;
  text-decoration: none;
  background: #fffaf3;
  border: 1px solid #ead8c5;
  border-radius: 18px;
  box-shadow: none;
}

#templatesScreen .seedance-link-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #8b4a18;
  background: #ffe8b8;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 700;
}

#templatesScreen .seedance-link-banner strong,
#templatesScreen .seedance-link-banner small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#templatesScreen .seedance-link-banner strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

#templatesScreen .seedance-link-banner small {
  margin-top: 4px;
  color: #806f61;
  font-size: 12px;
  font-weight: 500;
}

#templatesScreen .seedance-link-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #9a551c;
  background: #f6e6d5;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}

#templatesScreen .hot-copy-link-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #a5402d;
  background: #ffe0d5;
  border-radius: 13px;
  box-shadow: none;
  font-size: 16px;
  font-weight: 700;
  transform: none;
}

#templatesScreen .hot-copy-link-banner strong,
#templatesScreen .hot-copy-link-banner small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#templatesScreen .hot-copy-link-banner strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

#templatesScreen .hot-copy-link-banner small {
  margin-top: 4px;
  color: #806f61;
  font-size: 12px;
  font-weight: 500;
}

#templatesScreen .hot-copy-link-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #9a551c;
  background: #f6e6d5;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}

.app-screen-home .home-hot-copy-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  min-height: 112px;
  padding: 42px 14px 14px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(118deg, #612612 0%, #9e421a 56%, #d47632 100%);
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 23px;
  box-shadow: 0 13px 26px rgba(105, 51, 19, 0.18);
  isolation: isolate;
}

.app-screen-home .home-hot-copy-entry::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(53, 19, 8, 0.96) 0%, rgba(71, 26, 10, 0.86) 38%, rgba(75, 27, 8, 0.44) 61%, rgba(58, 20, 6, 0.08) 100%),
    linear-gradient(0deg, rgba(42, 13, 3, 0.48), transparent 58%);
  content: "";
}

.app-screen-home .home-hot-copy-image {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -2;
  width: 62%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  transform: scale(1.03);
}

.app-screen-home .home-hot-copy-mark {
  position: absolute;
  top: 13px;
  left: 14px;
  display: grid;
  width: auto;
  height: 24px;
  padding: 0 9px;
  place-items: center;
  color: #fff;
  background: #f05e3e;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  box-shadow: 0 5px 12px rgba(82, 26, 9, 0.24);
  font: 800 11px/1 system-ui, sans-serif;
}

.app-screen-home .home-hot-copy-entry strong,
.app-screen-home .home-hot-copy-entry small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-screen-home .home-hot-copy-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-right: 6px;
}

.app-screen-home .home-hot-copy-entry strong {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 8px rgba(47, 15, 4, 0.35);
}

.app-screen-home .home-hot-copy-entry small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 5px rgba(47, 15, 4, 0.3);
}

.app-screen-home .home-hot-copy-entry b {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 11px;
  color: #8c3a12;
  background: rgba(255, 249, 236, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  box-shadow: 0 7px 16px rgba(71, 25, 8, 0.18);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.app-screen-home .home-hot-copy-entry b i {
  font-size: 17px;
  font-style: normal;
  line-height: 1;
}

#templatesScreen .inspiration-tag-section,
#templatesScreen .inspiration-featured {
  display: grid;
  gap: 9px;
  min-width: 0;
}

#templatesScreen .inspiration-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 0 2px;
}

#templatesScreen .inspiration-section-head > div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

#templatesScreen .inspiration-section-head img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

#templatesScreen .inspiration-section-head h2 {
  margin: 0;
  color: #3b2418;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.2px;
}

#templatesScreen .inspiration-section-head > button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  padding: 0 2px 0 8px;
  color: #7d746d;
  background: transparent;
  font-size: 12px;
  font-weight: 820;
}

#templatesScreen .inspiration-section-head > button img {
  width: 15px;
  height: 15px;
}

#templatesScreen .template-page-tabs {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 1px 1px 3px;
  overflow-x: auto;
  scroll-padding-inline: 0;
  scrollbar-width: none;
}

#templatesScreen .template-page-tabs::-webkit-scrollbar {
  display: none;
}

#templatesScreen .template-page-tabs.is-expanded {
  flex-wrap: nowrap;
  overflow-x: auto;
}

#templatesScreen .template-page-tabs button {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 38px;
  padding: 0 15px;
  color: #756b64;
  background: #fffaf3;
  border: 1px solid #eddfcf;
  border-radius: 17px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 760;
}

#templatesScreen .template-page-tabs:not(.is-expanded) button:nth-child(n + 6) {
  display: none;
}

#templatesScreen .template-page-tabs button.is-active,
#templatesScreen .template-page-tabs button[aria-pressed="true"] {
  color: #3a250f;
  background: #ffa728;
  border-color: #ffa728;
  box-shadow: 0 7px 14px rgba(226, 139, 28, 0.18);
}

#templatesScreen .inspiration-today {
  position: relative;
  display: block;
  min-height: 154px;
  overflow: hidden;
  padding: 0;
  background: #ffd363 url("./assets/pet-mobile-home-hero-robot-v2.webp") center / cover no-repeat;
  border: 1px solid rgba(244, 190, 71, 0.72);
  border-radius: 25px;
  box-shadow: 0 12px 26px rgba(184, 112, 24, 0.13);
}

#templatesScreen .inspiration-today > div {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  width: 57%;
  min-height: 154px;
  padding: 15px 0 14px 19px;
}

#templatesScreen .inspiration-today span {
  display: none;
}

#templatesScreen .inspiration-today h2 {
  margin: 0;
  color: #35170b;
  font-size: 30px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.8px;
}

#templatesScreen .inspiration-today p {
  max-width: 185px;
  margin: 9px 0 0;
  color: #6e4b29;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

#templatesScreen .inspiration-today button {
  position: static;
  justify-self: start;
  width: auto;
  min-width: 104px;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 14px;
  color: #fffaf4;
  background: #9f430d;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  box-shadow: 0 9px 18px rgba(150, 63, 12, 0.2);
  font-size: 12px;
  font-weight: 800;
  opacity: 1;
}

#templatesScreen .inspiration-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

#templatesScreen .inspiration-topic-heading {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  padding: 3px 2px 1px;
}

#templatesScreen .inspiration-topic-heading h2 {
  margin: 0;
  color: #35291f;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

#templatesScreen .inspiration-topic-heading p {
  margin: 0;
  color: #81756c;
  font-size: 11.5px;
  line-height: 1.4;
}

#templatesScreen .inspiration-action-grid > button {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 78px;
  padding: 9px 8px;
  text-align: left;
  background: #fff4f1;
  border: 1px solid #f2d9d3;
  border-radius: 19px;
  box-shadow: 0 8px 20px rgba(91, 62, 37, 0.06);
}

#templatesScreen .inspiration-action-grid > button:nth-of-type(2) {
  background: #f8faee;
  border-color: #e4e9c9;
}

#templatesScreen .inspiration-action-grid > button:nth-of-type(3) {
  background: #f8f3ff;
  border-color: #e5d9f4;
}

#templatesScreen .inspiration-action-grid > button:nth-of-type(4) {
  background: #f1f8ff;
  border-color: #d8e7f4;
}

#templatesScreen .inspiration-action-grid > button > img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 16px;
}

#templatesScreen .inspiration-action-grid > button > span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

#templatesScreen .inspiration-action-grid strong,
#templatesScreen .inspiration-action-grid small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#templatesScreen .inspiration-action-grid strong {
  color: #35251c;
  font-size: 13px;
  font-weight: 950;
}

#templatesScreen .inspiration-action-grid small {
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
}

#templatesScreen .inspiration-action-grid .inspiration-action-arrow {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: transparent;
}

#templatesScreen .inspiration-action-grid .inspiration-action-arrow img {
  width: 18px;
  height: 18px;
  filter: sepia(1) saturate(2.4) hue-rotate(346deg) brightness(0.72);
}

#templatesScreen .template-result-summary {
  min-height: 0;
  margin: -4px 2px 0;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
}

#templatesScreen .template-result-summary:empty {
  display: none;
}

#templatesScreen .template-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  width: 100%;
  min-width: 0;
}

#templatesScreen .template-library-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 50px;
  min-width: 0;
  min-height: 252px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  border: 1px solid #eadfd3;
  border-radius: 19px;
  box-shadow: 0 10px 22px rgba(78, 53, 32, 0.09);
}

#templatesScreen .template-library-media {
  position: relative;
  min-height: 202px;
  aspect-ratio: 0.82;
  overflow: hidden;
  background: #eee7df;
}

#templatesScreen .template-library-media > button[data-template-detail] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-radius: 0;
}

#templatesScreen .template-library-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

#templatesScreen .template-library-caption {
  position: absolute;
  right: 6px;
  bottom: 7px;
  left: 6px;
  display: grid;
  gap: 0;
  padding: 12px 7px 7px;
  color: #fff;
  background: rgba(46, 31, 20, 0.48);
  border-radius: 10px;
  backdrop-filter: blur(6px);
}

#templatesScreen .template-library-caption small {
  overflow: hidden;
  font-size: 10px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#templatesScreen .template-library-caption strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#templatesScreen .template-favorite-button {
  top: 7px;
  right: 7px;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(48, 33, 23, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 50%;
  font-size: 15px;
  backdrop-filter: blur(6px);
}

#templatesScreen .template-library-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 6px;
  background: #fffaf2;
}

#templatesScreen .template-library-actions button,
#templatesScreen .template-library-actions button:first-child {
  width: 86%;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  color: #3a250f;
  background: #ffa91f;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 7px 13px rgba(214, 133, 22, 0.2);
  font-size: 12px;
  font-weight: 600;
}

#templatesScreen .template-empty-state {
  grid-column: 1 / -1;
}

.phone-app[data-active-screen="templates"] .bottom-nav [data-open-screen="templates"] {
  color: #ff7f13;
}

.phone-app[data-active-screen="templates"] .bottom-nav [data-open-screen="templates"] img {
  filter: sepia(1) saturate(7) hue-rotate(347deg) brightness(1.07);
  opacity: 1;
}

@media (max-width: 380px) {
  #templatesScreen .inspiration-topbar .home-brand-title strong {
    font-size: 23px;
  }

  #templatesScreen .inspiration-search {
    grid-template-columns: 23px minmax(0, 1fr) 58px;
    gap: 8px;
    min-height: 56px;
    padding-left: 13px;
  }

  #templatesScreen .inspiration-search-submit {
    width: 58px;
    height: 44px;
    border-radius: 999px;
  }

  #templatesScreen .inspiration-search:has(#templateSearchClear:not([hidden])) input {
    padding-right: 52px;
  }

  #templatesScreen #templateSearchClear {
    right: 70px;
  }

  #templatesScreen .inspiration-search input {
    font-size: 16px;
  }

  #templatesScreen .inspiration-action-grid > button {
    position: relative;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 5px;
    min-height: 74px;
    padding: 7px 31px 7px 7px;
  }

  #templatesScreen .inspiration-action-grid > button > img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  #templatesScreen .inspiration-action-grid .inspiration-action-arrow {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
  }

  #templatesScreen .inspiration-action-grid strong {
    font-size: 13px;
  }

  #templatesScreen .inspiration-action-grid small {
    font-size: 12px;
    letter-spacing: 0;
  }

  #templatesScreen .template-page-grid {
    grid-auto-columns: auto;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  #templatesScreen .template-library-card {
    min-height: 232px;
    border-radius: 16px;
    scroll-snap-align: none;
  }

  #templatesScreen .template-library-media {
    min-height: 182px;
  }

  #templatesScreen .template-library-caption {
    right: 4px;
    bottom: 5px;
    left: 4px;
    padding: 8px 5px 5px;
    border-radius: 8px;
  }

  #templatesScreen .template-library-caption strong {
    font-size: 13px;
  }

  #templatesScreen .template-library-actions {
    padding: 5px 4px;
  }

  #templatesScreen .template-library-actions button,
  #templatesScreen .template-library-actions button:first-child {
    width: 92%;
    min-height: 44px;
    padding-inline: 8px;
    border-radius: 13px;
    font-size: 12px;
  }
}

@media (min-width: 420px) {
  #templatesScreen .template-page-content,
  #templatesScreen .inspiration-topbar {
    --mobile-content-gutter: 23px;
  }

  #templatesScreen .inspiration-today {
    min-height: 146px;
  }

  #templatesScreen .inspiration-today > div {
    min-height: 146px;
  }
}

/* v113 reference-led profile */
.profile-screen {
  min-height: 100dvh;
  padding-bottom: 0;
  background: #fffaf4;
}

.profile-topbar {
  display: flex;
  min-height: calc(66px + env(safe-area-inset-top));
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: calc(12px + env(safe-area-inset-top)) 19px 6px;
}

.profile-topbar .home-brand-lockup p {
  margin-top: 4px;
}

.profile-topbar .home-alert-button,
.profile-topbar .home-avatar-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
}

.profile-page-content {
  display: grid;
  gap: 13px;
  padding: 8px 14px calc(var(--nav-height) + 28px + env(safe-area-inset-bottom));
}

.profile-identity-card {
  position: relative;
  min-height: 248px;
  overflow: hidden;
  background: #ffd765;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 30px;
  box-shadow: 0 18px 42px rgba(167, 106, 31, 0.14);
}

.profile-identity-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.profile-identity-copy {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  width: 66%;
  align-items: center;
  column-gap: 10px;
  padding: 48px 0 0 22px;
}

.profile-identity-avatar {
  display: block;
  grid-column: 1;
  grid-row: 1 / 3;
  width: 70px;
  height: 70px;
  object-fit: cover;
  object-position: center;
  background: #fff7ed;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(96, 58, 26, 0.18);
}

.profile-name-row {
  display: flex;
  grid-column: 2;
  align-items: center;
  gap: 7px;
  margin-top: 0;
}

.profile-name-row h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #3b1d0d;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: -0.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-vip-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: #fff;
  background: #ff9b19;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
}

.profile-identity-copy > p {
  grid-column: 2;
  max-width: 126px;
  margin: 4px 0 0;
  color: #71491f;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.4;
}

.profile-stat-grid {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 74px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(100, 69, 35, 0.1);
  backdrop-filter: blur(14px);
}

.profile-stat-grid button {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 5px 3px;
  color: #32251c;
  background: transparent;
  border-radius: 0;
}

.profile-stat-grid button + button {
  border-left: 1px solid #f2e5d6;
}

.profile-stat-grid img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.88;
}

.profile-stat-grid strong {
  margin-top: 1px;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.profile-stat-grid span {
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.profile-membership-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  min-height: 78px;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  background: #fff2c9;
  border: 1px solid #f2d48c;
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(134, 91, 38, 0.08);
}

.profile-membership-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: #ffc557;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
}

.profile-membership-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.profile-membership-card > div {
  min-width: 0;
}

.profile-membership-card strong {
  display: block;
  color: #462719;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
}

.profile-membership-card p,
.profile-membership-card small {
  display: block;
  margin: 3px 0 0;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.profile-membership-card small {
  color: #a6601d;
}

.profile-membership-card > button {
  min-width: 88px;
  min-height: 42px;
  padding: 0 14px;
  color: #3a250f;
  background: #ffa51c;
  border: 1px solid #ff9a0f;
  border-radius: 999px;
  box-shadow: 0 9px 18px rgba(226, 132, 16, 0.2);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.profile-menu-card {
  overflow: hidden;
  padding: 3px 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(239, 226, 211, 0.9);
  border-radius: 26px;
  box-shadow: 0 16px 36px rgba(92, 63, 34, 0.1);
}

.profile-menu-card > button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  color: #332b26;
  background: transparent;
  border-radius: 0;
  text-align: left;
}

.profile-menu-card > button + button {
  border-top: 1px solid #f2e8dd;
}

.profile-menu-card strong {
  font-size: 14px;
  font-weight: 850;
}

.profile-menu-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
}

.profile-menu-icon.tone-gold {
  background: #fff0c7;
}

.profile-menu-icon.tone-rose {
  background: #ffe3e2;
}

.profile-menu-icon.tone-mint {
  background: #e0f5e7;
}

.profile-menu-icon.tone-blue {
  background: #e4eaff;
}

.profile-menu-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.profile-menu-arrow {
  width: 17px;
  height: 17px;
  object-fit: contain;
  opacity: 0.52;
}

.profile-notice-panel,
.profile-settings-panel {
  scroll-margin-top: 14px;
}

.profile-notice-panel {
  padding: 16px;
  background: #fff;
  border: 1px solid #eee0d1;
  border-radius: 22px;
  box-shadow: 0 14px 30px rgba(92, 63, 34, 0.09);
}

.profile-notice-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-notice-panel strong {
  color: #3b2b21;
  font-size: 16px;
  font-weight: 700;
}

.profile-notice-panel button {
  min-height: 36px;
  padding: 0 12px;
  color: #8d725d;
  background: #fff7ed;
  border: 1px solid #ead9c7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.profile-notice-panel p {
  margin: 10px 0 0;
  color: #81766c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.profile-screen .profile-settings-panel {
  gap: 9px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #eee0d1;
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(92, 63, 34, 0.1);
}

.profile-screen .profile-settings-panel label {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  min-height: 54px;
  margin-top: 0;
}

.profile-screen .profile-settings-panel label:nth-of-type(n + 3) {
  margin-top: 0;
}

.profile-settings-status {
  margin: 3px 2px 0;
  color: #88796d;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
}

.profile-screen .profile-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 3px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.profile-screen .profile-actions button {
  min-height: 44px;
  color: #6f5c4d;
  background: #fff7ed;
  border: 1px solid #ead9c7;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 850;
}

.profile-screen .profile-actions #clearAllDataBtn {
  color: #b45145;
  background: #fff2ef;
  border-color: #f2d1ca;
}

@media (max-width: 360px) {
  .profile-topbar {
    padding-inline: 14px;
  }

  .profile-topbar .home-brand-title strong {
    font-size: 25px;
  }

  .profile-topbar .home-brand-lockup p {
    font-size: 9.5px;
  }

  .profile-page-content {
    gap: 11px;
    padding-inline: 11px;
  }

  .profile-identity-card {
    min-height: 238px;
    border-radius: 27px;
  }

  .profile-identity-copy {
    grid-template-columns: 62px minmax(0, 1fr);
    width: 67%;
    column-gap: 8px;
    padding: 44px 0 0 17px;
  }

  .profile-identity-avatar {
    width: 62px;
    height: 62px;
  }

  .profile-name-row h2 {
    font-size: 17px;
  }

  .profile-identity-copy > p {
    max-width: 145px;
    font-size: 9.5px;
  }

  .profile-stat-grid {
    right: 10px;
    bottom: 10px;
    left: 10px;
    min-height: 68px;
    border-radius: 19px;
  }

  .profile-stat-grid strong {
    font-size: 17px;
  }

  .profile-membership-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  .profile-membership-icon {
    width: 42px;
    height: 42px;
  }

  .profile-membership-card strong {
    font-size: 13px;
  }

  .profile-membership-card > button {
    min-width: 78px;
    min-height: 40px;
    padding-inline: 11px;
  }

  .profile-menu-card {
    padding-inline: 13px;
  }

  .profile-menu-card > button {
    grid-template-columns: 36px minmax(0, 1fr) 20px;
    gap: 10px;
    min-height: 52px;
  }

  .profile-screen .profile-settings-panel label {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* v135 conversational assistant and mobile usability pass */
.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card,
#assistantScreen .assistant-chat-turn .reply-card {
  display: grid;
  gap: 7px;
  width: 100%;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card {
  order: 20;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card > .reply-head,
#assistantScreen .assistant-chat-log .reply-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0 4px;
}

#assistantScreen .reply-head > img,
#assistantScreen .assistant-chat-log .reply-head > img {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: cover;
  background: #fff3d2;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #f3c969, 0 7px 16px rgba(95, 63, 28, 0.13);
}

#assistantScreen .assistant-speaker {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#assistantScreen .assistant-speaker-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

#assistantScreen .assistant-speaker-line strong {
  color: #3b2b20;
  font-size: 13px;
  font-weight: 950;
}

#assistantScreen .assistant-speaker-line span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6e8f6c;
  font-size: 10px;
  font-weight: 800;
}

#assistantScreen .assistant-speaker-line i {
  width: 6px;
  height: 6px;
  background: #49ad72;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(73, 173, 114, 0.12);
}

#assistantScreen .reply-head #assistantReplyLead,
#assistantScreen .assistant-chat-log .reply-head p {
  margin: 0;
  color: #8b796d;
  font-size: 11px;
  line-height: 1.38;
}

#assistantScreen .prompt-card,
#assistantScreen .assistant-chat-turn .prompt-card {
  display: grid;
  gap: 10px;
  width: calc(100% - 46px);
  margin-left: 46px;
  padding: 13px 14px 14px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #eadfd2;
  border-radius: 7px 20px 20px 20px;
  box-shadow: 0 10px 24px rgba(76, 52, 29, 0.08);
}

#assistantScreen .prompt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#assistantScreen .prompt-card-head h2,
#assistantScreen .prompt-card-head button,
#assistantScreen .prompt-card #assistantPrompt,
#assistantScreen .assistant-chat-turn .prompt-card p {
  grid-row: auto;
}

#assistantScreen .prompt-card-head h2 {
  min-width: 0;
  font-size: 13px;
}

#assistantScreen .prompt-card-head button {
  min-height: 36px;
  padding-inline: 11px;
  color: #9a641d;
  background: #fff8eb;
  border: 1px solid #eed8b8;
  box-shadow: none;
  font-size: 11px;
}

#assistantPrompt.assistant-markdown,
.assistant-chat-log .assistant-markdown {
  color: #3d342e;
  font-size: 14px;
  line-height: 1.72;
}

.assistant-conversation-copy p {
  margin-bottom: 0;
}

.assistant-plan-details {
  overflow: hidden;
  background: #fffaf1;
  border: 1px solid #eedcc5;
  border-radius: 15px;
}

.assistant-plan-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 9px 11px 9px 13px;
  color: #6a4523;
  cursor: pointer;
  list-style: none;
}

.assistant-plan-details summary::-webkit-details-marker {
  display: none;
}

.assistant-plan-details summary > span {
  display: grid;
  gap: 2px;
}

.assistant-plan-details summary strong {
  color: #55371f;
  font-size: 13px;
}

.assistant-plan-details summary small {
  color: #9a826d;
  font-size: 10.5px;
  font-weight: 700;
}

.assistant-plan-details summary > img {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  padding: 4px;
  background: #fff;
  border-radius: 50%;
  filter: sepia(0.4) saturate(0.9);
  transition: transform 180ms ease;
}

.assistant-plan-details[open] summary > img {
  transform: rotate(90deg);
}

.assistant-plan-body {
  padding: 2px 13px 13px;
  border-top: 1px solid #f0e2d0;
}

.assistant-next-question {
  margin: 0;
  padding: 10px 11px;
  color: #72502e;
  background: #fff1cf;
  border-left: 3px solid #ffac34;
  border-radius: 4px 12px 12px 4px;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.52;
}

#assistantScreen .reply-card.is-thinking .prompt-card-head {
  display: none;
}

#assistantScreen .reply-card.is-thinking .prompt-card {
  width: auto;
  justify-self: start;
  padding: 12px 15px;
  border-radius: 7px 18px 18px 18px;
}

.assistant-typing {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #7f6b5d;
  font-size: 12px;
  font-weight: 750;
}

.assistant-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.assistant-typing-dots i {
  width: 6px;
  height: 6px;
  background: #f2a32b;
  border-radius: 50%;
  animation: assistant-typing-dot 900ms ease-in-out infinite;
}

.assistant-typing-dots i:nth-child(2) { animation-delay: 120ms; }
.assistant-typing-dots i:nth-child(3) { animation-delay: 240ms; }

@keyframes assistant-typing-dot {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.45; }
  35% { transform: translateY(-3px); opacity: 1; }
}

#assistantScreen .action-grid,
.phone-app.has-assistant-reply #assistantScreen .action-grid {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 4px 46px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

#assistantScreen .action-grid::-webkit-scrollbar {
  display: none;
}

#assistantScreen .action-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 13px;
  border-radius: 999px;
  scroll-snap-align: start;
  font-size: 12px;
}

#assistantScreen .action-grid img {
  width: 17px;
  height: 17px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll .assistant-add-reference,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .send-button {
  min-height: 44px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer:focus-within {
  border-color: #f0ad43;
  box-shadow: 0 0 0 3px rgba(240, 173, 67, 0.18), 0 -10px 28px rgba(87, 61, 35, 0.13);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer > input:focus-visible {
  outline: 2px solid #e99425 !important;
  outline-offset: 1px;
  border-radius: 8px;
  box-shadow: none !important;
}

#worksScreen .work-list {
  grid-template-columns: minmax(0, 1fr);
}

/* Accessibility hardening: keyboard entry, screen-reader status, and auth tabs. */
.app-skip-link {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 1200;
  min-height: 44px;
  padding: 11px 16px;
  color: #3d260d;
  background: #fffdf8;
  border: 2px solid #d58b34;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(76, 52, 29, 0.18);
  font-size: 14px;
  font-weight: 800;
  line-height: 20px;
  transform: translateY(calc(-100% - max(16px, env(safe-area-inset-top))));
}

.app-skip-link:focus-visible {
  outline: 3px solid rgba(203, 122, 34, 0.28);
  outline-offset: 2px;
  transform: translateY(0);
}

.app-screen h1[tabindex="-1"]:focus {
  outline: none;
}

.phone-app.is-keyboard-navigation .app-screen h1[tabindex="-1"]:focus {
  outline: 3px solid rgba(203, 122, 34, 0.34);
  outline-offset: 4px;
  border-radius: 4px;
}

.app-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#templatesScreen .inspiration-today h1 {
  margin: 0;
  color: #35170b;
  font-size: 30px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.8px;
}

#profileScreen .profile-auth-tabpanel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabpanel > label:not(.profile-auth-consent) {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  gap: 7px;
  padding: 10px 12px 12px;
  background: #fffdf9;
  border: 1px solid #eadfd5;
  border-radius: 14px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabpanel > label:not(.profile-auth-consent) > span {
  color: #655548;
  font-size: 12px;
  line-height: 1.3;
}

#profileScreen .profile-auth-form [aria-invalid="true"] {
  border-color: #c64d3d;
  outline: 3px solid rgba(198, 77, 61, 0.14);
  outline-offset: 1px;
}

#profileScreen .profile-auth-consent:has(input[aria-invalid="true"]) {
  border-color: #c64d3d;
  box-shadow: 0 0 0 3px rgba(198, 77, 61, 0.1);
}

/* v138 strict Agent entry state and mobile conversation layout */
#assistantScreen {
  min-height: 100svh;
  background: #fffaf5;
}

#assistantScreen .assistant-hero,
.phone-app.has-assistant-reply #assistantScreen .assistant-hero {
  min-height: 0;
  padding: calc(10px + env(safe-area-inset-top)) 14px 12px;
  overflow: visible;
  background: #fff2bd;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 8px 22px rgba(111, 75, 30, 0.07);
}

#assistantScreen .assistant-brand-row {
  min-height: 44px;
  padding-inline: 0;
}

#assistantScreen .assistant-showcase,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  min-height: 82px;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
  padding: 11px 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(225, 195, 143, 0.66);
  border-radius: 18px;
  box-shadow: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-robot,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-robot {
  position: static;
  width: 56px;
  height: 56px;
  max-width: none;
  object-fit: cover;
  object-position: center;
  background: #fff8e5;
  border: 1px solid #f2deb2;
  border-radius: 16px;
  transform: none;
}

#assistantScreen .assistant-showcase-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 0;
  text-align: left;
}

#assistantScreen .assistant-identity-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

#assistantScreen .assistant-identity-line > span:first-child {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  overflow: visible;
  color: #a46823;
  font-size: 10px;
  font-weight: 850;
  text-overflow: clip;
  white-space: nowrap;
}

#assistantScreen .ai-identity-chip {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 8px;
  color: #8e5a23;
  background: #fff9ec;
  border: 1px solid #efd9b2;
  border-radius: 999px;
  font-size: 9px;
  line-height: 20px;
}

#assistantScreen .assistant-showcase-copy h1 {
  margin: 0;
  color: #2f231c;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: -0.35px;
}

#assistantScreen .assistant-showcase-copy p {
  display: -webkit-box;
  max-width: none;
  margin: 1px 0 0;
  overflow: hidden;
  color: #76685d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#assistantScreen .assistant-content,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-content {
  display: grid;
  min-height: calc(100svh - 170px);
  align-content: start;
  justify-content: stretch;
  gap: 12px;
  margin: 0;
  padding: 16px 14px calc(130px + env(safe-area-inset-bottom));
}

#assistantScreen .sent-message-card,
.phone-app.has-assistant-reply #assistantScreen .sent-message-card,
#assistantScreen .assistant-chat-log .sent-message-card {
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: end;
  justify-self: end;
  gap: 7px;
  width: min(88%, 340px);
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#assistantScreen .sent-message-card[hidden] {
  display: none !important;
}

#assistantScreen .sent-message-card > div {
  padding: 11px 13px;
  background: #ffe9ae;
  border: 1px solid #f0cf7a;
  border-radius: 18px 18px 5px 18px;
  box-shadow: 0 7px 18px rgba(137, 91, 30, 0.08);
}

#assistantScreen .sent-message-card p {
  margin: 0;
  color: #3f3025;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
}

#assistantScreen .sent-message-card > img {
  width: 36px;
  height: 36px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #ecc66d;
}

#assistantScreen .reply-card,
.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card,
#assistantScreen .assistant-chat-turn .reply-card {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#assistantScreen .reply-card[hidden] {
  display: none !important;
}

#assistantScreen .reply-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

#assistantScreen .reply-head > img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  background: #fff8e5;
  border: 2px solid #fff;
  border-radius: 12px;
  box-shadow: 0 0 0 1px #ecc66d;
}

#assistantScreen .assistant-speaker {
  min-width: 0;
  padding-top: 1px;
}

#assistantScreen .assistant-speaker-line {
  min-height: 24px;
  gap: 6px;
}

#assistantScreen .assistant-speaker-line strong {
  font-size: 12px;
}

#assistantScreen .assistant-speaker-line span {
  font-size: 9px;
}

#assistantScreen .reply-head p {
  margin: 3px 0 0;
  padding: 0;
  color: #74675d;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

#assistantScreen .prompt-card,
#assistantScreen .assistant-chat-turn .prompt-card {
  display: grid;
  gap: 10px;
  margin: 0 0 0 46px;
  padding: 14px;
  background: #fff;
  border: 1px solid #eadfd3;
  border-radius: 6px 18px 18px 18px;
  box-shadow: 0 8px 20px rgba(75, 52, 32, 0.07);
}

#assistantScreen .prompt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#assistantScreen .prompt-card-head h2 {
  min-width: 0;
  margin: 0;
  font-size: 13px;
}

#assistantScreen .prompt-card-head button {
  min-width: 76px;
  min-height: 44px;
  padding: 0 12px;
  color: #81541d;
  background: #fff8eb;
  border: 1px solid #ecd6b7;
  border-radius: 13px;
  box-shadow: none;
  font-size: 11px;
}

#assistantPrompt.assistant-markdown,
#assistantScreen .assistant-chat-log .assistant-markdown {
  color: #3c342e;
  font-size: 14px;
  line-height: 1.72;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
  position: fixed;
  right: 12px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 40;
  width: min(calc(100% - 24px), 406px);
  transform: translateX(-50%);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  min-height: 108px;
  padding: 8px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dfd1c3;
  border-radius: 22px;
  box-shadow: 0 -8px 24px rgba(68, 47, 29, 0.11);
  backdrop-filter: blur(16px);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer:focus-within {
  border-color: #e1a23f;
  box-shadow: 0 0 0 3px rgba(232, 166, 66, 0.13), 0 -8px 24px rgba(68, 47, 29, 0.11);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer > textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 112px;
  margin: 0;
  padding: 10px 11px 4px;
  resize: none;
  color: #352e29;
  background: transparent;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer > textarea:focus {
  outline: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer > textarea::placeholder {
  color: var(--color-text-subtle, #7a6d64);
  opacity: 1;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-toolbar {
  position: static;
  display: block;
  min-width: 0;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll::-webkit-scrollbar {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll .assistant-feature-divider {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll [data-assistant-shortcut],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"].is-active {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 50px;
  width: auto;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  color: #594a3f;
  background: #fffaf4;
  border: 1px solid #e8dacc;
  border-radius: 12px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  scroll-snap-align: start;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll .assistant-add-reference {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 20px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"] {
  min-width: 58px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  border-radius: 4px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button span {
  max-width: none;
  overflow: visible;
  font-size: 11px;
  text-overflow: clip;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row .send-button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  align-self: center;
  background: #f3a515;
  border: 0;
  border-radius: 15px;
  box-shadow: 0 7px 14px rgba(192, 121, 16, 0.2);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row .send-button img {
  width: 21px;
  height: 21px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-popover,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-menu {
  bottom: calc(100% + 8px);
}

@media (max-width: 360px) {
  #assistantScreen .assistant-hero,
  .phone-app.has-assistant-reply #assistantScreen .assistant-hero {
    padding-inline: 11px;
  }

  #assistantScreen .assistant-showcase,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-robot,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-robot {
    width: 50px;
    height: 50px;
  }

  #assistantScreen .assistant-content,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-content {
    padding-inline: 11px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
    right: 9px;
    width: min(calc(100% - 18px), 406px);
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    gap: 4px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button:not(.assistant-add-reference),
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > [data-assistant-shortcut] {
    flex-basis: 46px;
    width: 46px;
    min-width: 46px;
    padding-inline: 5px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > [data-assistant-shortcut="quick"] {
    flex-basis: 52px;
    width: 52px;
    min-width: 52px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > [data-assistant-shortcut="more"] {
    order: 4;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > [data-assistant-shortcut="video"] {
    order: 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  #assistantScreen *,
  #assistantScreen *::before,
  #assistantScreen *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

#worksScreen .work-text-preview {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  color: #4e443d;
  font-size: 13px;
  line-height: 1.5;
}

#worksScreen .work-text-preview > img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 14px;
}

#worksScreen .work-text-preview > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

#worksScreen .work-text-preview span {
  color: #a85f1e;
  font-size: 12px;
  font-weight: 900;
}

#worksScreen .work-text-preview p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#worksScreen .work-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 10px;
}

#worksScreen .work-card-actions button,
#worksScreen .works-category-filter button {
  min-height: 44px;
}

.work-detail-markdown {
  color: #403832;
  font-size: 13.5px;
  line-height: 1.66;
}

.work-detail-markdown p,
.work-detail-markdown ul,
.work-detail-markdown ol,
.work-detail-markdown blockquote {
  white-space: normal;
}

.work-detail-actions button {
  min-height: 44px;
}

.phone-app button:focus-visible,
.phone-app a:focus-visible,
.phone-app input:focus-visible,
.phone-app select:focus-visible,
.phone-app textarea:focus-visible,
.work-detail-shell button:focus-visible {
  outline: 3px solid rgba(224, 125, 28, 0.56) !important;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .assistant-typing-dots i,
  .composer.is-input-empty {
    animation: none;
  }

  .assistant-plan-details summary > img {
    transition: none;
  }
}

/* v90 reference-led assistant */
.app-screen-assistant {
  background: #fffaf4;
}

.app-screen-assistant .assistant-hero {
  min-height: 0;
  padding: calc(12px + env(safe-area-inset-top)) 14px 0;
  overflow: visible;
  background: #fffaf4;
}

.app-screen-assistant .assistant-hero::after {
  display: none;
}

.assistant-brand-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 5px;
}

.assistant-brand-lockup {
  min-width: 0;
}

.assistant-brand-lockup > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-brand-lockup strong {
  color: #35180b;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -1px;
  white-space: nowrap;
}

.assistant-brand-lockup img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.assistant-brand-lockup p {
  margin: 5px 0 0;
  color: #826f61;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
}

.assistant-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.assistant-showcase {
  position: relative;
  min-height: 222px;
  margin-top: 10px;
  overflow: hidden;
  background: #ffd75d;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  box-shadow: 0 14px 28px rgba(187, 112, 16, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.assistant-showcase-robot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scaleX(-1);
}

.assistant-showcase-copy {
  position: relative;
  z-index: 2;
  width: 56%;
  margin-left: 42%;
  padding: 18px 14px 0 0;
  color: #3b1d0d;
  text-align: center;
}

.assistant-showcase-copy > span {
  display: block;
  color: #8e5a1e;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.14em;
}

.assistant-showcase-copy h1 {
  margin: 4px 0 0;
  color: #35170a;
  font-size: 28px;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: 1px;
}

.assistant-showcase-copy p {
  margin: 6px 0 0;
  color: #71491f;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.35;
}

.app-screen-assistant .assistant-feature-toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 37%;
  z-index: 5;
  display: block;
  width: auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  backdrop-filter: none;
}

.app-screen-assistant:not(.is-active) .assistant-feature-toolbar {
  display: none;
}

.app-screen-assistant .assistant-feature-scroll {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  padding: 0;
}

.app-screen-assistant .assistant-feature-scroll button {
  display: grid;
  min-width: 0;
  min-height: 76px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 7px 3px 6px;
  color: #503522;
  background: rgba(255, 251, 239, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 17px;
  box-shadow: 0 8px 17px rgba(130, 78, 19, 0.1);
}

.app-screen-assistant .assistant-feature-scroll button.is-active {
  color: #bf630f;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 2px rgba(255, 150, 24, 0.18), 0 8px 17px rgba(130, 78, 19, 0.11);
}

.app-screen-assistant .assistant-feature-scroll img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 9px;
}

.app-screen-assistant .assistant-feature-scroll span {
  max-width: 100%;
  overflow: hidden;
  font-size: 8.5px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-screen-assistant .assistant-mode-popover {
  position: absolute;
  right: 13px;
  bottom: 93px;
  left: auto;
  z-index: 10;
  width: 184px;
  transform: none;
}

.app-screen-assistant .assistant-content {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 12px;
  min-height: 0;
  margin-top: 0;
  padding: 12px 14px calc(var(--nav-height) + 92px + env(safe-area-inset-bottom));
}

.assistant-welcome-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #efe1d1;
  border-radius: 23px;
  box-shadow: 0 10px 22px rgba(99, 66, 34, 0.08);
}

.assistant-welcome-card > img,
.reply-head > img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  object-position: 75% 36%;
  background: #ffd44f;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #f4c958, 0 8px 16px rgba(137, 87, 20, 0.12);
}

.assistant-welcome-card strong {
  display: block;
  color: #3f2c20;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.3;
}

.assistant-welcome-card p {
  margin: 5px 0 0;
  color: #75695f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

.assistant-welcome-card span {
  display: block;
  margin-top: 8px;
  color: #b16c22;
  font-size: 10px;
  font-weight: 850;
}

.app-screen-assistant .assistant-block {
  gap: 10px;
  margin-top: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.91);
  border: 1px solid #efe1d1;
  border-radius: 23px;
  box-shadow: 0 10px 22px rgba(99, 66, 34, 0.07);
}

.assistant-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assistant-block-head span {
  color: #a99585;
  font-size: 10px;
  font-weight: 800;
}

.app-screen-assistant .assistant-block h2 {
  margin: 0;
  color: #3d281c;
  font-size: 17px;
  font-weight: 950;
}

.app-screen-assistant .style-pills {
  display: flex;
  gap: 7px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-screen-assistant .style-pills::-webkit-scrollbar {
  display: none;
}

.app-screen-assistant .style-pills button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  color: #7a6a5e;
  background: #fffaf4;
  border: 1px solid #eadccf;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.app-screen-assistant .style-pills button.is-active {
  color: #fff;
  background: #ff8a18;
  border-color: transparent;
  box-shadow: 0 7px 14px rgba(224, 113, 10, 0.2);
}

.app-screen-assistant .preview-grid {
  display: block;
}

.app-screen-assistant .assistant-inspiration-strip {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: 17px;
  box-shadow: 0 10px 20px rgba(71, 49, 27, 0.12);
}

.assistant-preview-note {
  margin: 0;
  color: #9a8d83;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
}

.app-screen-assistant .sent-message-card {
  display: none;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: end;
  justify-self: end;
  gap: 8px;
  width: min(90%, 350px);
  max-width: none;
  margin: 0 0 0 auto;
  padding: 0;
  color: #442d1f;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.app-screen-assistant .sent-message-card > div {
  padding: 11px 14px;
  background: linear-gradient(135deg, #fff4cc, #ffe5a0);
  border: 1px solid rgba(247, 199, 94, 0.54);
  border-radius: 20px 20px 6px 20px;
  box-shadow: 0 10px 20px rgba(184, 118, 24, 0.1);
}

.app-screen-assistant .sent-message-card p {
  color: #442d1f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.app-screen-assistant .sent-message-card > img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #efc669;
}

.phone-app.has-assistant-reply .assistant-welcome-card {
  display: none;
}

.phone-app.has-assistant-reply .assistant-hero {
  min-height: 0;
  padding-bottom: 0;
  overflow: visible;
}

.phone-app.has-assistant-reply .assistant-showcase {
  display: block;
}

.phone-app.has-assistant-reply .assistant-content {
  display: grid;
  min-height: 0;
  justify-content: stretch;
  gap: 12px;
  margin-top: 0;
  padding-top: 12px;
  padding-bottom: calc(var(--nav-height) + 92px + env(safe-area-inset-bottom));
}

.phone-app.has-assistant-reply .sent-message-card {
  display: grid;
}

#assistantScreen .reply-card,
.assistant-chat-log .reply-card {
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.phone-app.has-assistant-reply #assistantScreen .reply-card {
  display: grid;
}

.app-screen-assistant .reply-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
}

.app-screen-assistant .reply-head p {
  margin: 0;
  padding: 11px 13px;
  color: #4d4036;
  background: #fff;
  border: 1px solid #eee1d4;
  border-radius: 7px 20px 20px 20px;
  box-shadow: 0 10px 20px rgba(80, 55, 31, 0.08);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.app-screen-assistant .prompt-card {
  gap: 8px;
  margin-left: 55px;
  padding: 13px;
  background: linear-gradient(135deg, #fffaf0, #fff4d8);
  border: 1px solid #f0d8a5;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(148, 93, 24, 0.08);
}

.app-screen-assistant .prompt-card h2 {
  color: #4a3020;
  font-size: 14px;
}

.app-screen-assistant .prompt-card p {
  color: #625348;
  font-size: 11px;
  line-height: 1.58;
}

.app-screen-assistant .prompt-card-head button {
  min-height: 34px;
  padding: 0 12px;
  color: #fff;
  background: #ff9b12;
  border-color: transparent;
  font-size: 10px;
}

.app-screen-assistant .generation-panel {
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #eee1d4;
  border-radius: 23px;
  box-shadow: 0 10px 22px rgba(80, 55, 31, 0.08);
}

.app-screen-assistant .generation-body > img,
.app-screen-assistant .generation-body > video {
  max-height: 360px;
  border-radius: 18px;
}

.app-screen-assistant .generation-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.app-screen-assistant .generation-actions button {
  min-height: 40px;
  padding: 0 6px;
  font-size: 9px;
}

.app-screen-assistant .action-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.phone-app.has-assistant-reply #assistantScreen .action-grid {
  display: grid;
}

.app-screen-assistant .action-grid button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 50px;
  align-items: center;
  gap: 5px;
  padding: 7px 6px;
  color: #4f3c2f;
  background: #fff;
  border: 1px solid #eee1d4;
  border-radius: 17px;
  box-shadow: 0 8px 17px rgba(80, 55, 31, 0.07);
}

.app-screen-assistant .action-grid img {
  width: 22px;
  height: 22px;
  padding: 0;
  object-fit: contain;
  background: transparent;
  border-radius: 7px;
}

.app-screen-assistant .action-grid span {
  font-size: 9px;
  line-height: 1.2;
  text-align: left;
}

.app-screen-assistant .quick-block {
  margin-bottom: 0;
}

.app-screen-assistant .assistant-chat-log,
.app-screen-assistant .assistant-chat-turn {
  gap: 12px;
}

.app-screen-assistant .assistant-chat-turn {
  opacity: 1;
}

.app-screen-assistant .composer {
  grid-template-columns: 42px minmax(0, 1fr) 46px;
  gap: 7px;
  width: min(calc(100% - 24px), 406px);
  min-height: 60px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #ecdfd1;
  border-radius: 27px;
  box-shadow: 0 -10px 30px rgba(78, 53, 29, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.app-screen-assistant .composer input {
  min-height: 44px;
  padding: 0 12px;
  background: #fffaf5;
  border: 1px solid #ede1d5;
  border-radius: 19px;
  font-size: 13px;
}

.app-screen-assistant .voice-button,
.app-screen-assistant .send-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 17px;
}

.app-screen-assistant .send-button {
  width: 46px;
  min-width: 46px;
  background: #ffb917;
  box-shadow: 0 8px 16px rgba(206, 132, 12, 0.2);
}

.app-screen-assistant .voice-button::before,
.app-screen-assistant .voice-button::after,
.app-screen-assistant .send-button::before {
  display: none;
}

.app-screen-assistant .voice-button img,
.app-screen-assistant .send-button img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

@media (max-width: 360px) {
  .app-screen-assistant .assistant-hero {
    padding-inline: 12px;
  }

  .assistant-brand-lockup strong {
    font-size: 26px;
  }

  .assistant-brand-lockup p {
    font-size: 9.5px;
  }

  .assistant-showcase {
    min-height: 206px;
  }

  .assistant-showcase-copy {
    width: 58%;
    margin-left: 40%;
  }

  .assistant-showcase-copy h1 {
    font-size: 24px;
  }

  .app-screen-assistant .assistant-feature-toolbar {
    left: 34%;
    right: 9px;
    bottom: 9px;
  }

  .app-screen-assistant .assistant-feature-scroll {
    gap: 4px;
  }

  .app-screen-assistant .assistant-feature-scroll button {
    min-height: 68px;
    border-radius: 14px;
  }

  .app-screen-assistant .assistant-feature-scroll img {
    width: 24px;
    height: 24px;
  }

  .app-screen-assistant .assistant-feature-scroll span {
    font-size: 7.5px;
  }

  .app-screen-assistant .assistant-content {
    padding-inline: 12px;
  }

  .app-screen-assistant .prompt-card {
    margin-left: 0;
  }

  .app-screen-assistant .action-grid {
    gap: 5px;
  }

  .app-screen-assistant .action-grid button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 56px;
  }

  .app-screen-assistant .action-grid span {
    text-align: center;
  }
}

/* v106 assistant subpage hierarchy */
.assistant-back-home {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px 0 13px;
  color: #5a351d;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(224, 177, 102, 0.52);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(143, 87, 23, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  backdrop-filter: blur(14px);
}

.assistant-back-home img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.82;
}

.assistant-back-home:active {
  transform: translateY(1px);
}

.phone-app[data-active-screen="assistant"] {
  --nav-height: 0px;
}

.phone-app[data-active-screen="assistant"] > .bottom-nav {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen {
  min-height: 100dvh;
  padding-bottom: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-content {
  padding-bottom: calc(94px + env(safe-area-inset-bottom));
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer {
  bottom: calc(8px + env(safe-area-inset-bottom));
}

@media (max-width: 360px) {
  .assistant-back-home {
    min-height: 38px;
    padding-inline: 10px;
  }
}

/* v97 assistant capability sizing lock */
#assistantScreen .assistant-feature-scroll .assistant-add-reference {
  flex: 0 0 34px;
}

#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"],
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="writing"],
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="image"],
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="more"] {
  flex: 0 0 56px;
  min-width: 56px;
  width: 56px;
  max-width: 56px;
  padding-inline: 1px;
}

@media (max-width: 360px) {
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"],
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="writing"],
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="image"],
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="more"] {
    flex-basis: 54px;
    min-width: 54px;
    width: 54px;
    max-width: 54px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: #f2e8dd;
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(244, 231, 216, 0.96)),
    #f2e8dd;
}

body.is-modal-open {
  overflow: hidden;
}

button,
a,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: wait;
  opacity: 0.62;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(79, 144, 238, 0.36);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.phone-app {
  position: relative;
  isolation: isolate;
  width: min(100%, var(--app-shell-max-width, 430px));
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(255, 246, 235, 0.98) 58%, rgba(246, 235, 222, 0.98) 100%),
    var(--page);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(121, 91, 58, 0.06), 0 28px 80px rgba(74, 52, 32, 0.18);
}

.app-screen {
  display: none;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + 32px + env(safe-area-inset-bottom));
}

.app-screen.is-active {
  display: block;
}

.phone-app button,
.phone-app a,
.phone-app input,
.phone-app select,
.phone-app textarea {
  min-height: 44px;
}

.app-screen-home {
  background:
    linear-gradient(180deg, #fff8ee 0%, #fff4e8 48%, #f8eadb 100%);
}

.home-hero {
  position: relative;
  min-height: 500px;
  padding: calc(15px + env(safe-area-inset-top)) 22px 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 252, 245, 0.96) 0%, rgba(255, 250, 240, 0.7) 46%, rgba(255, 250, 242, 0.12) 72%),
    linear-gradient(180deg, #fffaf1 0%, #fff4e8 100%);
}

.home-hero::before {
  position: absolute;
  left: 138px;
  bottom: 60px;
  z-index: 4;
  width: 122px;
  height: 122px;
  pointer-events: none;
  background: url("./assets/pet-mobile-reference-feature-robot.png") center / contain no-repeat;
  content: "";
  filter: drop-shadow(0 18px 24px rgba(56, 86, 88, 0.14));
}

.home-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 132px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 246, 235, 0) 0%, rgba(255, 246, 235, 0.86) 72%, #fff4e8 100%);
  content: "";
}

.status-row {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  color: rgba(30, 34, 48, 0.86);
  font-size: 14px;
  font-weight: 800;
}

.status-icons {
  font-size: 11px;
  letter-spacing: 0;
  opacity: 0.82;
}

.member-pill {
  position: absolute;
  top: calc(35px + env(safe-area-inset-top));
  right: 20px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 15px 4px 8px;
  color: #a35c18;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(235, 190, 122, 0.62);
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(143, 91, 38, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(18px);
}

.member-pill img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.member-pill span {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.member-pill.compact {
  position: static;
  min-height: 44px;
  padding: 4px 12px 4px 7px;
}

.member-pill.compact img {
  width: 26px;
  height: 26px;
}

.brand-lockup {
  position: relative;
  z-index: 7;
  width: 64%;
  margin-top: 50px;
}

.brand-lockup h1 {
  margin: 0;
  color: #242838;
  font-size: 54px;
  font-weight: 950;
  line-height: 1.16;
  letter-spacing: 0;
  padding-bottom: 3px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.76);
  white-space: nowrap;
}

.brand-lockup h1 span,
.brand-lockup p span {
  color: var(--orange);
}

.brand-lockup p {
  max-width: 260px;
  margin: 14px 0 0;
  color: #2d3143;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}

.hero-trust-row {
  display: none;
}

.hero-note {
  position: absolute;
  top: calc(226px + env(safe-area-inset-top));
  left: 44px;
  z-index: 7;
  width: 150px;
  margin: 0;
  padding: 18px 18px 30px;
  color: #171b2a;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px 28px 24px 28px;
  box-shadow: 0 18px 36px rgba(104, 75, 45, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.98);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.48;
  white-space: nowrap;
  transform: rotate(-6deg);
}

.hero-note::after {
  position: absolute;
  right: 35px;
  bottom: 6px;
  width: 34px;
  height: 24px;
  background: rgba(255, 255, 255, 0.88);
  clip-path: polygon(0 0, 100% 0, 70% 100%);
  content: "";
}

.hero-pet {
  position: absolute;
  top: calc(82px + env(safe-area-inset-top));
  right: -58px;
  z-index: 3;
  width: 322px;
  height: 404px;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(1.08) contrast(1.04) drop-shadow(0 28px 34px rgba(112, 74, 36, 0.24));
}

.home-content {
  position: relative;
  z-index: 10;
  display: grid;
  gap: 14px;
  margin-top: -184px;
  padding: 0 18px calc(var(--nav-height) + 42px + env(safe-area-inset-bottom));
}

.home-prompt-panel,
.content-card,
.assistant-bridge,
.reply-card,
.assistant-block,
.generation-panel,
.tool-spotlight,
.settings-list,
.empty-work-panel {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(18px);
}

.home-prompt-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 30px;
}

.home-prompt-panel::after,
.section-head::after {
  position: absolute;
  right: 20px;
  top: 22px;
  width: 22px;
  height: 22px;
  background: url("./assets/pet-mobile-brand-paw.png") center / contain no-repeat;
  content: "";
  opacity: 0.22;
}

.home-prompt-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-prompt-head h2 {
  margin: 0;
  color: #181c2d;
  font-size: 25px;
  font-weight: 950;
  line-height: 1.18;
}

.home-prompt-head button,
.section-head > button {
  min-height: 44px;
  padding: 0 6px 0 12px;
  color: #777a84;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.home-prompt-chips {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.home-prompt-chips button {
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  overflow: hidden;
  color: var(--chip-ink, #d57a18);
  background: var(--chip-bg, rgba(255, 246, 232, 0.96));
  border: 1px solid var(--chip-line, rgba(244, 201, 126, 0.45));
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-prompt-chips button:nth-child(2) {
  --chip-bg: rgba(232, 250, 242, 0.96);
  --chip-line: rgba(97, 191, 144, 0.3);
  --chip-ink: #257f5a;
}

.home-prompt-chips button:nth-child(3) {
  --chip-bg: rgba(255, 242, 240, 0.96);
  --chip-line: rgba(244, 139, 129, 0.32);
  --chip-ink: #db635a;
}

.home-prompt-chips button:nth-child(4) {
  --chip-bg: rgba(239, 247, 255, 0.96);
  --chip-line: rgba(108, 160, 226, 0.3);
  --chip-ink: #4c78ad;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.feature-grid::-webkit-scrollbar {
  display: none;
}

.feature-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: stretch;
  min-width: 0;
  min-height: 154px;
  height: 154px;
  overflow: hidden;
  padding: 14px 11px 66px;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 26px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.feature-card:active,
.case-strip button:active,
.template-grid button:active,
.tool-list button:active,
.tool-list a:active,
.profile-insights button:active,
.action-grid button:active {
  transform: translateY(1px) scale(0.99);
}

.feature-blue {
  color: #1a8d64;
  background: linear-gradient(145deg, rgba(239, 255, 249, 0.98), rgba(216, 247, 234, 0.9));
}

.feature-purple {
  color: #9a551c;
  background: linear-gradient(145deg, rgba(255, 250, 241, 0.98), rgba(255, 229, 189, 0.92));
}

.feature-green {
  color: #bd6b12;
  background: linear-gradient(145deg, rgba(255, 252, 246, 0.98), rgba(255, 239, 212, 0.92));
}

.feature-title {
  position: relative;
  z-index: 3;
  display: block;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.18;
  white-space: nowrap;
}

.feature-copy {
  position: relative;
  z-index: 3;
  display: block;
  max-width: 100%;
  min-height: 36px;
  margin-top: 7px;
  color: rgba(55, 60, 75, 0.78);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.38;
}

.feature-thumb {
  position: absolute;
  right: auto;
  bottom: 11px;
  left: 11px;
  z-index: 2;
  width: 46px;
  height: 44px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 14px 18px rgba(82, 74, 65, 0.16));
}

.feature-purple .feature-thumb {
  right: auto;
  bottom: 11px;
  left: 11px;
  width: 42px;
  height: 46px;
}

.feature-green .robot-thumb {
  right: auto;
  bottom: 11px;
  left: 9px;
  width: 50px;
  height: 46px;
}

.feature-icon {
  position: absolute;
  right: 9px;
  bottom: 10px;
  z-index: 4;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(105, 85, 60, 0.16));
}

.assistant-bridge {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 13px;
  border-radius: 26px;
}

.app-screen-home .assistant-bridge {
  display: none;
}

.assistant-bridge img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.8);
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  box-shadow: 0 12px 20px rgba(92, 64, 36, 0.12);
}

.assistant-bridge div {
  min-width: 0;
}

.assistant-bridge span {
  display: block;
  color: #ba6b18;
  font-size: 12px;
  font-weight: 950;
}

.assistant-bridge strong {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: #242838;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.assistant-bridge button,
.tool-spotlight > button {
  color: #fff;
  background: linear-gradient(135deg, #ff8d35, #e5a833);
  border-radius: 18px;
  box-shadow: 0 13px 24px rgba(222, 130, 34, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 950;
}

.content-card {
  position: relative;
  display: grid;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
  padding: 17px;
  border-radius: 30px;
}

.feature-grid + .content-card {
  margin-top: 8px;
}

.app-screen-home .assistant-bridge + .content-card {
  margin-top: 8px;
}

.app-screen-home .content-card {
  padding: 12px 14px;
}

.section-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-head > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.section-head img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.section-head h2,
.assistant-block h2,
.generation-head h2,
.settings-head strong {
  margin: 0;
  color: #202437;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.18;
}

.section-head > button {
  position: relative;
  padding-right: 18px;
}

.section-head > button::after {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.case-strip {
  display: grid;
  grid-auto-columns: minmax(74px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding: 0 2px 4px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.case-strip::-webkit-scrollbar,
.template-tabs::-webkit-scrollbar,
.style-pills::-webkit-scrollbar,
.quick-pills::-webkit-scrollbar {
  display: none;
}

.case-strip button {
  position: relative;
  min-width: 0;
  height: 52px;
  padding: 0;
  overflow: hidden;
  color: #222638;
  background: transparent;
  border-radius: 16px;
  text-align: center;
}

.case-strip img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 11px 18px rgba(82, 61, 38, 0.12);
}

.case-strip strong {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  display: block;
  margin: 0;
  padding: 3px 4px;
  overflow: hidden;
  color: #fff;
  background: rgba(30, 34, 48, 0.46);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.case-strip span {
  display: none;
  margin-top: 2px;
  overflow: hidden;
  color: #9a9aa4;
  font-size: 9.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card {
  margin-top: 48px;
}

.template-tabs,
.template-page-tabs,
.style-pills,
.quick-pills {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.template-tabs button,
.template-page-tabs button,
.style-pills button,
.quick-pills button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 15px;
  color: #7b746f;
  background: rgba(255, 249, 241, 0.86);
  border: 1px solid rgba(232, 214, 191, 0.8);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 820;
  white-space: nowrap;
}

.template-tabs button.is-active,
.template-page-tabs button.is-active,
.style-pills button.is-active,
.agent-mode-switch button.is-active {
  color: #3a250f;
  background: linear-gradient(135deg, #ff8a31, #e6a82e);
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(226, 132, 35, 0.22);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.template-grid button {
  position: relative;
  min-height: 138px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 14px 26px rgba(83, 62, 39, 0.1);
}

.template-grid img {
  width: 100%;
  height: 100%;
  min-height: 138px;
  object-fit: cover;
}

.template-grid span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  min-height: 28px;
  padding: 6px 8px;
  overflow: hidden;
  color: #fff;
  background: rgba(29, 34, 48, 0.48);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.template-page-content {
  gap: 14px;
}

.template-center-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: center;
  gap: 12px;
  min-height: 166px;
  overflow: hidden;
  padding: 20px;
  background:
    radial-gradient(circle at 86% 16%, rgba(255, 217, 134, 0.54), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 239, 217, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  box-shadow: var(--shadow-card);
}

.template-center-hero span,
.template-library-body > span {
  color: #c7701b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
}

.template-center-hero h2 {
  max-width: 210px;
  margin: 8px 0 0;
  color: #242838;
  font-size: 26px;
  font-weight: 950;
  line-height: 1.12;
}

.template-center-hero p {
  max-width: 218px;
  margin: 10px 0 0;
  color: #686a75;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.48;
}

.template-center-hero img {
  position: relative;
  z-index: 1;
  width: 118px;
  height: 118px;
  object-fit: cover;
  border: 6px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  box-shadow: 0 18px 30px rgba(93, 65, 36, 0.16);
}

.template-center-panel {
  display: grid;
  gap: 12px;
}

.template-page-tabs {
  margin: 0 -2px;
}

.template-page-grid {
  display: grid;
  gap: 12px;
}

.template-library-card {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.template-library-media {
  min-width: 0;
}

.template-library-media img {
  width: 100%;
  height: 136px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 14px 24px rgba(83, 62, 39, 0.1);
}

.template-library-body {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.template-library-body h3 {
  margin: 0;
  overflow: hidden;
  color: #242838;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-library-body p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0;
  overflow: hidden;
  color: #686a75;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.template-library-content {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 9px;
  background: rgba(255, 248, 238, 0.72);
  border: 1px solid rgba(236, 210, 178, 0.58);
  border-radius: 14px;
}

.template-library-content b,
.template-library-content small,
.template-library-content em {
  display: -webkit-box;
  overflow: hidden;
  font-style: normal;
  line-height: 1.35;
  -webkit-box-orient: vertical;
}

.template-library-content b {
  color: #32283a;
  font-size: 12px;
  font-weight: 950;
  -webkit-line-clamp: 1;
}

.template-library-content small {
  color: #6d6570;
  font-size: 11px;
  font-weight: 760;
  -webkit-line-clamp: 2;
}

.template-library-content em {
  color: #bc6d22;
  font-size: 10px;
  font-weight: 900;
  -webkit-line-clamp: 1;
}

.template-library-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 2px;
}

.template-library-actions button {
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  color: #8e5a20;
  background: rgba(255, 248, 237, 0.94);
  border: 1px solid rgba(234, 204, 164, 0.78);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.16;
  white-space: nowrap;
}

.template-library-actions button:first-child {
  color: #3a250f;
  background: linear-gradient(135deg, #ff8a31, #e6a82e);
  border-color: transparent;
  box-shadow: 0 10px 16px rgba(226, 132, 35, 0.18);
}

/* Mobile-first general template center. */
.template-page-content {
  gap: 16px;
  padding-bottom: 112px;
}

.template-center-hero {
  grid-template-columns: minmax(0, 1fr) 104px;
  min-height: 172px;
  padding: 18px;
  background: #fffaf3;
  border: 1px solid #f0dfca;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(74, 55, 36, 0.08);
}

.template-center-hero h2 {
  max-width: 220px;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.18;
}

.template-center-hero p {
  max-width: 225px;
  margin-top: 7px;
  color: #575b66;
  font-size: 12px;
  line-height: 1.42;
}

.template-center-hero img {
  width: 104px;
  height: 132px;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 12px 22px rgba(52, 45, 37, 0.14);
}

.template-hero-stats {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
}

.template-hero-stats b {
  color: #8b480f;
  font-size: 19px;
  font-weight: 950;
}

.template-hero-stats small {
  color: #6f675f;
  font-size: 10px;
  font-weight: 760;
}

.template-search {
  position: relative;
  display: grid;
}

.template-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.template-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 48px 0 15px;
  color: #252833;
  background: #fff;
  border: 1px solid #ddcfbd;
  border-radius: 12px;
  outline: none;
  font: inherit;
  font-size: 14px;
  font-weight: 720;
}

.template-search input:focus {
  border-color: #9c5a1f;
  box-shadow: 0 0 0 3px rgba(156, 90, 31, 0.16);
}

.template-search button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #4d4f59;
  background: transparent;
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
}

.template-page-tabs {
  margin: 0 -16px;
  padding: 0 16px 4px;
  scroll-padding-inline: 16px;
}

.template-page-tabs button {
  min-height: 44px;
  padding: 0 14px;
  color: #4f515b;
  background: #fff;
  border-color: #dfd3c5;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: none;
}

.template-page-tabs button.is-active {
  color: #fff;
  background: #30343f;
  border-color: #30343f;
  box-shadow: none;
}

.template-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.template-media-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.template-media-filters button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 11px;
  color: #50525c;
  background: #f4efe9;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
}

.template-media-filters button.is-active {
  color: #713a0d;
  background: #ffe1bd;
  border-color: #e9b87f;
}

.template-sort-label {
  display: grid;
  gap: 2px;
  color: #656771;
  font-size: 9px;
  font-weight: 800;
}

.template-sort-label select {
  min-height: 42px;
  max-width: 86px;
  padding: 0 26px 0 9px;
  color: #30323b;
  background-color: #fff;
  border: 1px solid #ddd1c3;
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.template-result-summary {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
}

.template-page-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-library-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  background: #fff;
  border: 1px solid #e7ded2;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(64, 50, 35, 0.08);
}

.template-library-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #eee9e2;
}

.template-library-media img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

.template-trend-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 56px);
  padding: 5px 7px;
  overflow: hidden;
  color: #fff;
  background: rgba(37, 40, 49, 0.88);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-favorite-button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #5b3719;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(34, 30, 26, 0.16);
}

.template-favorite-button[aria-pressed="true"] {
  color: #9b3d25;
}

.template-library-body {
  display: grid;
  gap: 6px;
  padding: 11px;
}

.template-library-body > span {
  color: #8a4c16;
  font-size: 10px;
  line-height: 1.3;
}

.template-library-body h3 {
  min-height: 38px;
  font-size: 16px;
  line-height: 1.18;
  white-space: normal;
}

.template-library-body p {
  min-height: 48px;
  color: #5f616b;
  font-size: 11px;
  line-height: 1.42;
  -webkit-line-clamp: 3;
}

.template-library-body > em {
  overflow: hidden;
  color: #696b75;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-library-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}

.template-library-actions button,
.template-library-actions button:first-child {
  min-height: 44px;
  padding: 0 5px;
  color: #69360c;
  background: #ffd6a7;
  border: 1px solid #e7ad6d;
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}

.template-library-actions button:last-child {
  color: #3f414b;
  background: #f5f1ec;
  border-color: #ddd3c7;
}

.template-empty-state {
  grid-column: 1 / -1;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 24px 18px;
  background: #fff;
  border: 1px solid #e3d9cd;
  border-radius: 12px;
}

.template-empty-state strong {
  color: #292c35;
  font-size: 16px;
}

.template-empty-state p {
  margin: 0;
  color: #676a73;
  font-size: 12px;
}

.template-empty-state button {
  min-height: 44px;
  padding: 0 14px;
  color: #6a370d;
  background: #ffd6a7;
  border: 1px solid #e7ad6d;
  border-radius: 9px;
  font-weight: 900;
}

.template-detail-sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 520px);
  max-width: none;
  max-height: min(88dvh, 820px);
  margin: auto;
  overflow: hidden;
  padding: 0;
  color: #292c35;
  background: #fffdf9;
  border: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 50px rgba(31, 27, 24, 0.2);
}

.template-detail-sheet::backdrop {
  background: rgba(30, 27, 25, 0.48);
  backdrop-filter: blur(2px);
}

.template-detail-handle {
  width: 42px;
  height: 4px;
  margin: 8px auto 2px;
  background: #d5cec5;
  border-radius: 4px;
}

.template-detail-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid #eee4d9;
}

.template-detail-sheet > header span {
  color: #8a4c16;
  font-size: 10px;
  font-weight: 900;
}

.template-detail-sheet h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.template-detail-sheet > header button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #454750;
  background: #f2ede7;
  border-radius: 10px;
  font-size: 25px;
}

.template-detail-scroll {
  display: grid;
  gap: 12px;
  max-height: calc(min(88dvh, 820px) - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 18px;
}

html.has-template-detail-open,
html.has-template-detail-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.template-detail-scroll > img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
}

.template-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-detail-meta span {
  padding: 6px 8px;
  color: #474a54;
  background: #f2ede7;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 850;
}

.template-detail-scroll section {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e9dfd4;
  border-radius: 10px;
}

.template-detail-scroll h3 {
  margin: 0;
  color: #8a4c16;
  font-size: 11px;
  font-weight: 900;
}

.template-detail-scroll strong,
.template-detail-scroll p {
  margin: 0;
  color: #3d4049;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.template-detail-source {
  color: #666973 !important;
  font-size: 10px !important;
}

.template-detail-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 249, 0.97);
  border-top: 1px solid #e9dfd4;
}

.template-detail-actions button {
  min-width: 0;
  min-height: 46px;
  padding: 0 4px;
  color: #3c3f48;
  background: #f2ede7;
  border: 1px solid #ddd3c8;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.template-detail-actions button:first-child {
  color: #67340c;
  background: #ffd6a7;
  border-color: #e7ad6d;
}

.agent-cancel-button {
  min-height: 42px;
  padding: 0 14px;
  color: #7c321f;
  background: #fff0ea;
  border: 1px solid #dca38f;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 370px) {
  .template-center-hero {
    grid-template-columns: minmax(0, 1fr) 88px;
    padding: 15px;
  }

  .template-center-hero img {
    width: 88px;
    height: 116px;
  }

  .template-page-grid {
    gap: 9px;
  }

  .template-library-body {
    padding: 9px;
  }

  .template-library-body h3 {
    font-size: 15px;
  }

  .template-library-actions button,
  .template-library-actions button:first-child {
    min-height: 44px;
    font-size: 12px;
  }
}

#templatesScreen .template-duo-cover {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: #e9e0d6;
}

#templatesScreen .template-duo-cover > .template-duo-cover-main {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

#templatesScreen .template-duo-cover-companion {
  position: absolute;
  top: 9px;
  right: 9px;
  display: block;
  width: 54px;
  height: 54px;
  overflow: hidden;
  background: #fff;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(45, 26, 15, 0.28);
}

#templatesScreen .template-duo-cover-companion > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* v198 — Douyin AI-baby production prompt sheets */
.template-detail-sheet.is-prompt-template {
  --prompt-ink: #171719;
  --prompt-cyan: #3ee4d1;
  --prompt-pink: #ff3e70;
}

.template-detail-sheet.is-prompt-template > header {
  color: #fff;
  background:
    linear-gradient(90deg, var(--prompt-cyan) 0 36%, transparent 36% 43%, var(--prompt-pink) 43% 100%) top / 100% 3px no-repeat,
    var(--prompt-ink);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.template-detail-sheet.is-prompt-template > header span {
  color: var(--prompt-cyan);
  letter-spacing: 0.08em;
}

.template-detail-sheet.is-prompt-template > header button {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.template-detail-sheet.is-prompt-template .template-detail-scroll {
  gap: 10px;
  padding-top: 10px;
}

.template-detail-sheet.is-prompt-template .template-detail-scroll > img {
  height: 132px;
  max-height: 132px;
  object-position: center 38%;
  border-radius: 14px;
}

.template-detail-sheet.is-prompt-template .template-detail-meta span {
  color: #3f3a36;
  background: #f4eee8;
  border: 1px solid #e9ddd1;
}

.template-detail-sheet.is-prompt-template .template-prompt-section {
  gap: 10px;
  padding: 15px;
  color: #fff;
  background: var(--prompt-ink);
  border-color: #2f2d31;
  border-radius: 15px;
  box-shadow: 5px 5px 0 rgba(255, 62, 112, 0.13);
}

.template-prompt-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-detail-sheet.is-prompt-template .template-prompt-heading h3 {
  color: var(--prompt-cyan);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.template-prompt-heading button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  color: #171719;
  background: var(--prompt-cyan);
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.template-detail-sheet.is-prompt-template #templateDetailPlan {
  color: #f8f7f5;
  font-size: 13px;
  line-height: 1.72;
  user-select: text;
}

.template-detail-sheet.is-prompt-template #templateDetailPrompt {
  color: #49433e;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
}

.template-detail-sheet.is-prompt-template #templateDetailCharacterSection {
  position: relative;
  padding-left: 16px;
  background: #effbf8;
  border-color: #bee9df;
}

.template-detail-sheet.is-prompt-template #templateDetailCharacterSection::before,
.template-detail-sheet.is-prompt-template #templateDetailScriptSection::before,
.template-detail-sheet.is-prompt-template #templateDetailWorkflowSection::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  content: "";
}

.template-detail-sheet.is-prompt-template #templateDetailCharacterSection::before {
  background: var(--prompt-cyan);
}

.template-detail-sheet.is-prompt-template #templateDetailScriptSection {
  position: relative;
  padding-left: 16px;
  background: #fff5f7;
  border-color: #f4cbd5;
}

.template-detail-sheet.is-prompt-template #templateDetailScriptSection::before {
  background: var(--prompt-pink);
}

.template-detail-sheet.is-prompt-template #templateDetailScript {
  font-size: 12.5px;
  line-height: 1.7;
  user-select: text;
}

.template-detail-sheet.is-prompt-template #templateDetailWorkflowSection {
  position: relative;
  padding-left: 16px;
  background: #f6f3ff;
  border-color: #ddd3f4;
}

.template-detail-sheet.is-prompt-template #templateDetailWorkflowSection::before {
  background: #8971d8;
}

.template-detail-sheet.is-prompt-template .template-detail-actions button:first-child {
  color: #171719;
  background: var(--prompt-cyan);
  border-color: #21c9b7;
}

.template-detail-sheet.is-prompt-template .template-detail-actions button:nth-child(2) {
  color: #fff;
  background: #222225;
  border-color: #222225;
}

.template-library-card:has([data-template-action="prompt"]) .template-library-actions > button {
  color: #fff;
  background: #1d1d20;
  border-color: #1d1d20;
  box-shadow: inset 3px 0 0 #3ee4d1, inset -3px 0 0 #ff3e70;
}

.template-library-card:has([data-template-action="prompt"]) .template-library-caption small {
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 370px) {
  .template-detail-sheet.is-prompt-template .template-detail-scroll > img {
    height: 108px;
  }

  .template-prompt-heading button {
    padding-inline: 10px;
  }
}

/* v196 · evidence-led Douyin template library and creator publishing flow */
#templatesScreen {
  --trend-ink: #201816;
  --trend-hot: #ff365f;
  --trend-signal: #22ddd3;
  --trend-paper: #fffaf3;
}

#templatesScreen .inspiration-today span {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  margin-bottom: 7px;
  padding: 0 9px;
  color: #5b2c13;
  background: rgba(255, 251, 239, 0.72);
  border: 1px solid rgba(126, 62, 18, 0.13);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

#templatesScreen .inspiration-today h1 {
  margin: 0;
  color: #35170b;
  font-size: 30px;
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: -0.8px;
}

#templatesScreen .inspiration-today p {
  max-width: 200px;
  margin-top: 7px;
  font-size: 11.5px;
}

#templatesScreen .inspiration-today button {
  min-width: 130px;
  min-height: 42px;
  margin-top: 9px;
}

#templatesScreen .inspiration-publish-entry {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0 11px;
  min-width: 0;
  padding: 15px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(34, 221, 211, 0.2), transparent 30%),
    radial-gradient(circle at 5% 94%, rgba(255, 54, 95, 0.2), transparent 34%),
    var(--trend-ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: 0 12px 24px rgba(48, 31, 28, 0.13);
}

#templatesScreen .inspiration-publish-entry::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--trend-signal) 0 36%, #fff 36% 42%, var(--trend-hot) 42% 100%);
  content: "";
}

#templatesScreen .inspiration-signal-mark {
  display: flex;
  min-height: 54px;
  align-items: end;
  gap: 2px;
}

#templatesScreen .inspiration-signal-mark i {
  display: block;
  width: 4px;
  height: 19px;
  background: var(--trend-signal);
  border-radius: 99px;
  transform: rotate(8deg);
}

#templatesScreen .inspiration-signal-mark i:nth-child(2) {
  height: 34px;
  background: #fff;
}

#templatesScreen .inspiration-signal-mark i:nth-child(3) {
  height: 26px;
  background: var(--trend-hot);
}

#templatesScreen .inspiration-publish-entry > div:nth-child(2) {
  min-width: 0;
}

#templatesScreen .inspiration-publish-entry span,
#templatesScreen .inspiration-publish-entry h2,
#templatesScreen .inspiration-publish-entry p {
  display: block;
  margin: 0;
}

#templatesScreen .inspiration-publish-entry span {
  color: var(--trend-signal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

#templatesScreen .inspiration-publish-entry h2 {
  margin-top: 4px;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

#templatesScreen .inspiration-publish-entry p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 11px;
  line-height: 1.45;
}

#templatesScreen .inspiration-publish-entry > button {
  grid-column: 2;
  display: inline-flex;
  width: fit-content;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding: 0 11px 0 14px;
  color: #201816;
  background: #fff;
  border: 0;
  border-radius: 999px;
  box-shadow: 5px 5px 0 var(--trend-hot), -2px -2px 0 var(--trend-signal);
  font-size: 12px;
  font-weight: 900;
}

#templatesScreen .inspiration-publish-entry > button b {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #fff;
  background: var(--trend-ink);
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
}

#templatesScreen .template-filter-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px;
  background: #f2ebe3;
  border-radius: 15px;
}

#templatesScreen .template-media-filter {
  display: flex;
  min-width: 0;
  gap: 3px;
}

#templatesScreen .template-media-filter button {
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  color: #746860;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
}

#templatesScreen .template-media-filter button.is-active,
#templatesScreen .template-media-filter button[aria-pressed="true"] {
  color: #2d211b;
  background: #fff;
  box-shadow: 0 4px 10px rgba(65, 43, 28, 0.08);
}

#templatesScreen .template-sort-control {
  position: relative;
  display: flex;
  min-width: 104px;
  min-height: 34px;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  color: #7a6c63;
  background: #fffaf5;
  border: 1px solid #e5d9ce;
  border-radius: 10px;
}

#templatesScreen .template-sort-control > span {
  font-size: 9px;
  font-weight: 800;
}

#templatesScreen .template-sort-control select {
  min-width: 0;
  height: 32px;
  padding: 0 1px;
  color: #352820;
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 800;
}

#templatesScreen .template-library-caption {
  gap: 3px;
}

#templatesScreen .template-library-caption small {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  font-weight: 700;
}

#templatesScreen .template-share-collection {
  min-height: 44px;
  color: #6f5e52;
  background: transparent;
  border: 1px dashed #d9cabd;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
}

.template-publish-sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 520px);
  max-width: 100%;
  max-height: min(94dvh, 900px);
  margin: auto auto 0;
  padding: 0;
  overflow: hidden;
  color: #2d211c;
  background: #fffaf4;
  border: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -18px 60px rgba(31, 20, 17, 0.25);
}

.template-publish-sheet::backdrop {
  background: rgba(30, 22, 19, 0.52);
  backdrop-filter: blur(4px);
}

.template-publish-sheet > header {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 20px 15px;
  color: #fff;
  background:
    linear-gradient(105deg, rgba(34, 221, 211, 0.12), transparent 38%),
    linear-gradient(285deg, rgba(255, 54, 95, 0.16), transparent 42%),
    #201816;
}

.template-publish-sheet > header::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #22ddd3 0 36%, #fff 36% 42%, #ff365f 42%);
  content: "";
}

.template-publish-sheet > header span,
.template-publish-sheet > header h2,
.template-publish-sheet > header p {
  margin: 0;
}

.template-publish-sheet > header span {
  color: #22ddd3;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.template-publish-sheet > header h2 {
  margin-top: 4px;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.5px;
}

.template-publish-sheet > header p {
  max-width: 340px;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  line-height: 1.5;
}

.template-publish-sheet > header > button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-size: 24px;
}

.template-publish-sheet form {
  display: grid;
  max-height: calc(min(94dvh, 900px) - 108px);
  grid-template-rows: minmax(0, 1fr) auto;
}

.template-publish-scroll {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 18px 18px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.template-publish-scroll label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.template-publish-scroll label > span:first-child {
  color: #51423a;
  font-size: 12px;
  font-weight: 850;
}

.template-publish-scroll label > span b {
  color: #e83f59;
}

.template-publish-scroll input[type="text"],
.template-publish-scroll input[type="url"],
.template-publish-scroll select,
.template-publish-scroll textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  color: #30231d;
  background: #fff;
  border: 1px solid #e4d7cb;
  border-radius: 14px;
  box-shadow: none;
  font: 500 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  resize: vertical;
}

.template-publish-scroll textarea {
  min-height: 86px;
}

.template-publish-scroll input:focus,
.template-publish-scroll select:focus,
.template-publish-scroll textarea:focus {
  border-color: #2acfc6;
  outline: 3px solid rgba(34, 221, 211, 0.16);
}

.template-publish-scroll label > small {
  justify-self: end;
  margin-top: -3px;
  color: #8a7c72;
  font-size: 10px;
  line-height: 1.4;
}

.template-publish-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.template-publish-cover {
  position: relative;
}

.template-publish-cover > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.template-publish-cover-preview {
  display: grid !important;
  min-height: 96px;
  place-items: center;
  gap: 5px;
  padding: 12px;
  overflow: hidden;
  color: #3c2d26 !important;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(34, 221, 211, 0.1), transparent 45%),
    linear-gradient(315deg, rgba(255, 54, 95, 0.08), transparent 48%),
    #f3ece5;
  border: 1px dashed #cdbdb0;
  border-radius: 16px;
  cursor: pointer;
}

.template-publish-cover-preview:has(img) {
  grid-template-columns: 64px minmax(0, 1fr);
  justify-items: start;
  text-align: left;
}

.template-publish-cover-preview img {
  width: 64px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

.template-publish-cover-preview span {
  display: grid;
  gap: 4px;
}

.template-publish-cover-preview b {
  font-size: 12px;
  font-weight: 900;
}

.template-publish-cover-preview small,
.template-publish-source small {
  color: #807168;
  font-size: 10px;
  line-height: 1.45;
}

.template-publish-rights {
  grid-template-columns: 22px minmax(0, 1fr) !important;
  align-items: start;
  gap: 10px !important;
  padding: 12px;
  background: #f1ebe4;
  border-radius: 14px;
}

.template-publish-rights input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: #ef3e5c;
}

.template-publish-rights span {
  color: #625249 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.55;
}

.template-publish-error {
  margin: 0;
  padding: 10px 12px;
  color: #a7293f;
  background: #fff0f2;
  border: 1px solid #f3c8d0;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.template-publish-sheet form > footer {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 244, 0.96);
  border-top: 1px solid #e7dbcf;
  backdrop-filter: blur(16px);
}

.template-publish-sheet form > footer button {
  min-height: 48px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 900;
}

.template-publish-sheet form > footer button:first-child {
  color: #6c5e55;
  background: #eee6df;
}

.template-publish-sheet form > footer button:last-child {
  color: #fff;
  background: #201816;
  box-shadow: 4px 4px 0 #ff365f, -2px -2px 0 #22ddd3;
}

.template-publish-sheet form > footer button:disabled {
  opacity: 0.55;
}

html.has-template-publish-open,
html.has-template-publish-open body {
  overflow: hidden;
}

@media (max-width: 370px) {
  #templatesScreen .template-filter-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #templatesScreen .template-media-filter button {
    flex: 1 1 0;
  }

  #templatesScreen .template-sort-control {
    justify-content: space-between;
  }

  .template-publish-pair {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #templatesScreen .inspiration-publish-entry > button,
  .template-publish-sheet form > footer button:last-child {
    scroll-behavior: auto;
  }
}

.app-screen-assistant {
  background:
    linear-gradient(180deg, #fff9f1 0%, #fff4e8 42%, #f8eadb 100%);
}

.assistant-hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  padding: calc(16px + env(safe-area-inset-top)) 18px 0;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98) 0%, rgba(255, 247, 235, 0.95) 58%, rgba(239, 250, 244, 0.86) 100%);
}

.assistant-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 92px;
  background: linear-gradient(180deg, rgba(255, 244, 232, 0), #fff4e8 88%);
  content: "";
}

.assistant-topbar,
.screen-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.assistant-topbar h1 {
  margin: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 950;
}

.back-button,
.voice-button,
.send-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  color: #2d3143;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(233, 215, 194, 0.8);
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(101, 72, 41, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.back-button::before {
  width: 11px;
  height: 11px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
  transform: translateX(2px) rotate(45deg);
}

.assistant-intro {
  position: relative;
  z-index: 2;
  min-height: 212px;
  margin-top: 18px;
}

.assistant-intro img {
  position: absolute;
  left: -52px;
  bottom: -18px;
  width: 236px;
  height: auto;
  filter: drop-shadow(0 20px 26px rgba(89, 60, 35, 0.16));
}

.assistant-intro div {
  position: relative;
  z-index: 3;
  margin-left: 136px;
  padding: 22px 17px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.assistant-intro p {
  margin: 0;
  color: #202437;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.24;
}

.assistant-intro span {
  display: block;
  margin-top: 8px;
  color: #626574;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.52;
}

.user-bubble {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  align-items: center;
  gap: 10px;
  max-width: 310px;
  margin: -6px 0 0 auto;
  padding: 12px 12px 12px 16px;
  color: #fff;
  background: linear-gradient(135deg, #ff963d, #ecb23d);
  border-radius: 22px 22px 8px 22px;
  box-shadow: 0 16px 28px rgba(221, 127, 36, 0.23);
}

.user-bubble span {
  min-width: 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.user-bubble img {
  width: 62px;
  height: 46px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
}

.assistant-content {
  position: relative;
  z-index: 8;
  display: grid;
  gap: 14px;
  margin-top: -36px;
  padding: 0 16px calc(var(--nav-height) + 236px + env(safe-area-inset-bottom));
}

.reply-card,
.assistant-block,
.generation-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 28px;
}

.reply-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.reply-head img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: #fff;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 17px;
  box-shadow: 0 9px 18px rgba(93, 66, 40, 0.12);
}

.reply-head p {
  margin: 0;
  color: #333849;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.46;
}

.prompt-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 246, 235, 0.86));
  border: 1px solid rgba(232, 215, 196, 0.72);
  border-radius: 22px;
}

.prompt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.prompt-card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}

.prompt-card-head button,
.generation-actions button,
.work-card-actions button,
.work-detail-actions button,
.profile-actions button,
.empty-work-actions button,
.screen-header > button:not(.back-button) {
  min-height: 44px;
  padding: 0 14px;
  color: #a35c18;
  background: rgba(255, 247, 235, 0.96);
  border: 1px solid rgba(236, 205, 164, 0.74);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.prompt-card p,
.generation-prompt-preview,
.work-detail-body p,
.work-text-preview {
  margin: 0;
  color: #4e5362;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.34;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-status {
  order: -1;
  margin: 0;
  padding: 10px 12px;
  color: #8c5f22;
  background: rgba(255, 247, 235, 0.78);
  border: 1px solid rgba(237, 207, 168, 0.72);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.42;
}

.agent-status[data-state="busy"] {
  color: #466a9c;
  background: rgba(238, 247, 255, 0.86);
  border-color: rgba(164, 200, 239, 0.65);
}

.agent-status[data-state="done"] {
  color: #287851;
  background: rgba(235, 251, 244, 0.86);
  border-color: rgba(151, 216, 181, 0.65);
}

.agent-status[data-state="error"] {
  color: #b45a1b;
  background: rgba(255, 245, 235, 0.9);
}

.agent-mode-switch {
  order: -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.agent-mode-switch button {
  min-height: 44px;
  color: #79746d;
  background: rgba(255, 249, 241, 0.86);
  border: 1px solid rgba(232, 214, 191, 0.8);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.assistant-feature-toolbar {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-height) + 76px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 38;
  display: grid;
  grid-template-columns: 42px 1px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: min(calc(100% - 28px), 402px);
  min-height: 50px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.975);
  border: 1px solid rgba(225, 210, 190, 0.8);
  border-radius: 22px;
  box-shadow: 0 -14px 34px rgba(87, 61, 35, 0.16), 0 5px 18px rgba(87, 61, 35, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.98);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.app-screen-assistant:not(.is-active) .assistant-feature-toolbar {
  display: none;
}

.assistant-mode-popover {
  position: fixed;
  bottom: var(--assistant-mode-popover-bottom, calc(var(--nav-height) + 144px + env(safe-area-inset-bottom)));
  left: var(--assistant-mode-popover-left, calc(50% - min(calc(100% - 28px), 402px) / 2 + 101px));
  z-index: 39;
  display: grid;
  grid-template-columns: repeat(3, minmax(48px, 1fr));
  gap: 6px;
  width: min(210px, calc(100% - 48px));
  padding: 7px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(225, 210, 190, 0.86);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(71, 49, 28, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.assistant-mode-popover[hidden],
.app-screen-assistant:not(.is-active) .assistant-mode-popover {
  display: none;
}

.assistant-mode-popover button {
  min-height: 44px;
  color: #5a6170;
  background: rgba(255, 249, 242, 0.86);
  border: 1px solid rgba(232, 214, 191, 0.72);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 950;
}

.assistant-mode-popover button.is-active {
  color: #fff;
  background: linear-gradient(135deg, #282d3f, #f08b24);
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(210, 116, 33, 0.18);
}

.assistant-add-button,
.assistant-feature-scroll button {
  position: relative;
  min-height: 44px;
  border: 0;
}

.assistant-add-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: #fff8ef;
  border: 1px solid rgba(233, 213, 188, 0.84);
  border-radius: 15px;
}

.assistant-add-button::before,
.assistant-add-button::after {
  position: absolute;
  width: 15px;
  height: 2px;
  background: #6a7180;
  border-radius: 999px;
  content: "";
}

.assistant-add-button::after {
  transform: rotate(90deg);
}

.assistant-feature-divider {
  width: 1px;
  height: 26px;
  background: rgba(207, 190, 169, 0.82);
}

.assistant-feature-scroll {
  display: flex;
  gap: 8px;
  min-width: 0;
  padding-right: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 8px 24px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
}

.assistant-feature-scroll::-webkit-scrollbar {
  display: none;
}

.assistant-feature-scroll button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 132px;
  padding: 0 11px;
  color: #4c5361;
  background: rgba(255, 249, 242, 0.78);
  border: 1px solid rgba(232, 214, 191, 0.72);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 900;
  scroll-snap-align: start;
  white-space: nowrap;
}

.assistant-feature-scroll button.is-active {
  color: #fff;
  background: linear-gradient(135deg, #282d3f, #f08b24);
  border-color: transparent;
  box-shadow: 0 9px 18px rgba(210, 116, 33, 0.18);
}

.assistant-feature-scroll button[data-assistant-shortcut="quick"] {
  padding-right: 18px;
}

.assistant-feature-scroll button[data-assistant-shortcut="quick"]::after {
  position: absolute;
  right: 8px;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: translateY(-1px) rotate(45deg);
}

.assistant-feature-scroll button[data-assistant-shortcut="quick"][aria-expanded="true"]::after {
  transform: translateY(2px) rotate(225deg);
}

.assistant-feature-icon {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  place-items: center;
}

.icon-fast::before {
  width: 8px;
  height: 15px;
  background: currentColor;
  clip-path: polygon(54% 0, 12% 54%, 47% 54%, 30% 100%, 88% 38%, 54% 38%);
  content: "";
}

.icon-music::before {
  width: 9px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  border-radius: 2px 3px 0 0;
  content: "";
  transform: translate(2px, -1px);
}

.icon-music::after {
  position: absolute;
  right: 2px;
  bottom: 1px;
  width: 7px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.icon-image::before {
  width: 15px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
  content: "";
}

.icon-image::after {
  position: absolute;
  bottom: 3px;
  left: 4px;
  width: 10px;
  height: 6px;
  background: currentColor;
  clip-path: polygon(0 100%, 38% 42%, 58% 70%, 75% 48%, 100% 100%);
  content: "";
}

.icon-video::before {
  width: 13px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 4px;
  content: "";
}

.icon-video::after {
  position: absolute;
  right: 0;
  width: 6px;
  height: 9px;
  background: currentColor;
  clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 80%);
  content: "";
}

.icon-ppt::before {
  width: 14px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
  content: "";
}

.icon-ppt::after {
  position: absolute;
  bottom: 3px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -4px 0 currentColor;
  content: "";
}

.icon-writing::before {
  width: 13px;
  height: 3px;
  background: currentColor;
  border-radius: 999px;
  content: "";
  transform: rotate(-35deg);
}

.icon-writing::after {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: "";
}

.icon-more::before,
.icon-more::after {
  position: absolute;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.icon-more::before {
  left: 1px;
  box-shadow: 6px 0 0 currentColor, 12px 0 0 currentColor;
}

.icon-more::after {
  display: none;
}

.generation-unavailable-card,
.generation-audio-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  background: rgba(255, 247, 237, 0.92);
  border: 1px solid rgba(239, 198, 151, 0.72);
  border-radius: 18px;
}

.generation-unavailable-card strong,
.generation-audio-card strong {
  color: #323748;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.35;
}

.generation-unavailable-card p,
.generation-audio-card p {
  margin: 0;
  color: #6b625a;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.generation-audio-card audio {
  width: 100%;
}

.style-pills,
.quick-pills {
  margin-top: 2px;
}

#assistantScreen .assistant-block[aria-labelledby="styleTitle"] {
  margin-top: 28px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-grid button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  color: #262b3d;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.action-grid img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  padding: 9px;
  background: rgba(255, 247, 235, 0.86);
  border-radius: 15px;
}

.action-grid span {
  min-width: 0;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preview-grid img {
  width: 100%;
  aspect-ratio: 0.78 / 1;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 12px 22px rgba(84, 61, 38, 0.1);
}

.preview-grid img:nth-child(3) {
  aspect-ratio: 0.78 / 1;
}

.generation-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 241, 0.9));
}

.generation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.generation-head span,
.screen-header span,
.tool-spotlight span,
.empty-work-copy span,
.settings-head span,
.work-detail-head span,
.generation-result-card span,
.generation-progress-card span {
  display: block;
  color: var(--color-brand-strong, #a94808);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.generation-head strong {
  flex: 0 0 auto;
  max-width: 126px;
  padding: 8px 11px;
  color: #8d5a20;
  background: rgba(255, 247, 235, 0.9);
  border: 1px solid rgba(236, 205, 164, 0.76);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.generation-head strong[data-state="busy"] {
  color: #406b9d;
  background: rgba(238, 247, 255, 0.9);
  border-color: rgba(160, 198, 239, 0.65);
}

.generation-head strong[data-state="done"] {
  color: #23794e;
  background: rgba(235, 251, 244, 0.9);
  border-color: rgba(151, 216, 181, 0.65);
}

.generation-body {
  display: grid;
  gap: 12px;
}

.generation-body > img,
.generation-body > video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  background: #f6eadc;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.generation-result-card,
.generation-progress-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 12px;
  background: rgba(255, 249, 241, 0.9);
  border: 1px solid rgba(236, 219, 197, 0.78);
  border-radius: 22px;
}

.generation-result-card img,
.generation-progress-visual img {
  width: 82px;
  height: 104px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 10px 18px rgba(82, 61, 39, 0.12);
}

.generation-result-card strong,
.generation-progress-card strong {
  display: block;
  margin-top: 5px;
  color: #242838;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.28;
}

.generation-result-card p,
.generation-progress-card p,
.generation-task-note {
  margin: 6px 0 0;
  color: #676a77;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.48;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.generation-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.generation-task-id {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  color: #777a84;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(229, 211, 191, 0.76);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.generation-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.generation-progress-steps li {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 6px;
  color: #9b938b;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(229, 211, 191, 0.72);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.generation-progress-steps li[data-state="done"],
.generation-progress-steps li[data-state="active"] {
  color: #fff;
  background: linear-gradient(135deg, #ff8a31, #e6a82e);
  border-color: transparent;
}

.generation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

#generationPanel:not([hidden]) + .action-grid {
  margin-top: calc(var(--nav-height) + 180px);
}

.generation-actions button:first-child,
.work-detail-actions button:first-child,
.empty-work-actions button:first-child {
  color: #fff;
  background: linear-gradient(135deg, #ff8a31, #e6a82e);
  border-color: transparent;
}

.generation-actions button:disabled,
.generation-panel[data-result-mode="error"] .generation-actions button:first-child {
  color: #a66f30;
  background: rgba(255, 247, 235, 0.92);
  border-color: rgba(236, 205, 164, 0.74);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.composer {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-height) + 6px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 36;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  width: min(calc(100% - 28px), 402px);
  min-height: 62px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 211, 191, 0.82);
  border-radius: 24px;
  box-shadow: 0 -12px 36px rgba(87, 61, 35, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.98);
  transform: translateX(-50%);
  backdrop-filter: blur(20px);
}

.composer[data-hint]::before {
  position: absolute;
  right: 14px;
  bottom: calc(100% + 8px);
  left: 14px;
  display: block;
  min-height: 38px;
  padding: 10px 14px;
  color: #b95717;
  background: rgba(255, 248, 238, 0.98);
  border: 1px solid rgba(244, 153, 83, 0.42);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(100, 67, 35, 0.14);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
  content: attr(data-hint);
}

.composer input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  color: #2a2e3f;
  background: rgba(255, 247, 237, 0.82);
  border: 1px solid rgba(232, 214, 191, 0.66);
  border-radius: 17px;
  font-size: 14px;
  font-weight: 700;
}

.composer input::placeholder {
  color: var(--color-text-subtle, #7a6d64);
}

.composer.is-input-empty {
  animation: composer-nudge 0.34s ease;
}

.composer.is-input-empty input,
.composer input[aria-invalid="true"] {
  background: rgba(255, 241, 231, 0.95);
  border-color: rgba(244, 113, 70, 0.86);
  box-shadow: 0 0 0 3px rgba(255, 138, 49, 0.14);
}

.composer.is-input-empty .send-button {
  box-shadow: 0 0 0 4px rgba(255, 138, 49, 0.18);
}

@keyframes composer-nudge {
  0%,
  100% {
    transform: translateX(-50%);
  }

  25% {
    transform: translateX(calc(-50% - 4px));
  }

  75% {
    transform: translateX(calc(-50% + 4px));
  }
}

.voice-button::before {
  width: 13px;
  height: 20px;
  background: var(--orange);
  border-radius: 9px;
  content: "";
}

.voice-button::after {
  position: absolute;
  bottom: 10px;
  width: 20px;
  height: 10px;
  border-right: 2px solid var(--orange);
  border-bottom: 2px solid var(--orange);
  border-left: 2px solid var(--orange);
  border-radius: 0 0 12px 12px;
  content: "";
}

.send-button {
  color: #fff;
  background: linear-gradient(135deg, #ff8a31, #e6a82e);
  border-color: transparent;
}

.send-button::before {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 15px solid #fff;
  content: "";
  transform: translateX(2px);
}

.library-screen {
  background:
    linear-gradient(180deg, #fff9f1 0%, #fff4e8 46%, #f8eadb 100%);
}

.screen-header {
  min-height: calc(96px + env(safe-area-inset-top));
  padding: calc(16px + env(safe-area-inset-top)) 16px 18px;
  background: rgba(255, 251, 246, 0.92);
  border-bottom: 1px solid rgba(234, 218, 199, 0.62);
  border-radius: 0 0 30px 30px;
  box-shadow: 0 14px 32px rgba(91, 65, 38, 0.08);
  backdrop-filter: blur(18px);
}

.screen-header > div {
  min-width: 0;
}

.screen-header h1 {
  margin: 5px 0 0;
  font-size: 30px;
  font-weight: 950;
  line-height: 1.18;
  padding-bottom: 3px;
}

.screen-content {
  display: grid;
  gap: 16px;
  padding: 16px 16px calc(var(--nav-height) + 42px + env(safe-area-inset-bottom));
}

.stats-grid,
.profile-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stats-grid div,
.profile-insights button {
  display: grid;
  align-content: center;
  min-height: 94px;
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.stats-grid strong {
  color: #242838;
  font-size: 25px;
  font-weight: 950;
}

.stats-grid span,
.profile-insights span {
  margin-top: 5px;
  color: #85838a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.empty-work-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 30px;
}

.empty-work-copy h2 {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.2;
}

.empty-work-copy p {
  margin: 8px 0 0;
  color: #686a75;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.empty-work-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.empty-work-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
}

.empty-work-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.work-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-list li {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}

.work-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.work-title-block {
  min-width: 0;
}

.work-title-block strong {
  display: block;
  overflow: hidden;
  font-size: 17px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-meta {
  margin: 4px 0 0;
  color: #9a9691;
  font-size: 11px;
  font-weight: 750;
}

.work-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 128px;
}

.work-type-pill,
.work-status-pill {
  min-height: 24px;
  padding: 5px 8px;
  color: #a35c18;
  background: rgba(255, 247, 235, 0.92);
  border: 1px solid rgba(236, 205, 164, 0.72);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.work-card-preview img,
.work-media img,
.work-media video {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 20px;
}

.work-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  min-height: 176px;
  overflow: hidden;
  padding: 18px 16px;
  border-radius: 30px;
}

.tool-spotlight::after {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 104px;
  height: 136px;
  background: url("./assets/pet-mobile-reference-case-corgi-v2.webp") center / cover no-repeat;
  border: 5px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  box-shadow: 0 16px 28px rgba(86, 60, 34, 0.15);
  content: "";
}

.tool-spotlight > div,
.tool-spotlight > button {
  position: relative;
  z-index: 2;
}

.tool-spotlight h2 {
  max-width: 190px;
  margin: 10px 0 0;
  font-size: 27px;
  font-weight: 950;
  line-height: 1.14;
}

.tool-spotlight p {
  max-width: 176px;
  margin: 10px 0 0;
  color: #666977;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.tool-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.tool-flow-steps b {
  min-height: 30px;
  padding: 7px 9px;
  color: #956022;
  background: rgba(255, 247, 235, 0.86);
  border: 1px solid rgba(236, 205, 164, 0.72);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.tool-spotlight > button {
  align-self: end;
  justify-self: end;
  min-width: 102px;
  min-height: 48px;
}

.tool-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-list button,
.tool-list a {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 132px;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.tool-list button::after,
.tool-list a::after {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 66px;
  height: 62px;
  background: var(--tool-art) center / contain no-repeat;
  content: "";
  opacity: 0.76;
}

.tool-list img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  padding: 10px;
  background: rgba(255, 250, 244, 0.9);
  border-radius: 16px;
  box-shadow: 0 10px 18px rgba(83, 62, 39, 0.1);
}

.tool-list strong {
  position: relative;
  z-index: 2;
  margin-top: 13px;
  color: #242838;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.2;
}

.tool-list span {
  position: relative;
  z-index: 2;
  max-width: 94px;
  margin-top: 6px;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.42;
  word-break: keep-all;
}

.tool-list [data-tool-tone="blue"] {
  --tool-art: url("./assets/pet-mobile-reference-feature-image.png");
}

.tool-list [data-tool-tone="purple"] {
  --tool-art: url("./assets/pet-mobile-reference-feature-video.png");
}

.tool-list [data-tool-tone="pink"] {
  --tool-art: url("./assets/pet-mobile-reference-case-cat-v2.webp");
}

.tool-list [data-tool-tone="green"] {
  --tool-art: url("./assets/pet-mobile-sample-spring.png");
}

.tool-list [data-tool-tone="gold"] {
  --tool-art: url("./assets/pet-mobile-brand-paw.png");
}

.tool-list [data-tool-tone="cream"] {
  --tool-art: url("./assets/pet-mobile-icon-toolbox.png");
}

.tool-list [data-tool-tone="template"] {
  --tool-art: url("./assets/pet-mobile-sample-princess.png");
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 176, 96, 0.24), transparent 34%),
    rgba(255, 255, 255, 0.9);
}
.tool-list [data-tool-tone="pc"] {
  --tool-art: url("./assets/pet-mobile-icon-toolbox.png");
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 145, 72, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(39, 45, 66, 0.97), rgba(20, 23, 36, 0.94));
  border-color: rgba(255, 204, 143, 0.48);
}

.tool-list [data-tool-tone="gold"],
.tool-list [data-tool-tone="cream"],
.tool-list [data-tool-tone="template"],
.tool-list [data-tool-tone="pc"] {
  min-height: 96px;
  height: 96px;
  padding: 10px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  align-content: center;
  column-gap: 8px;
}

.tool-list [data-tool-tone="gold"]::after,
.tool-list [data-tool-tone="cream"]::after,
.tool-list [data-tool-tone="template"]::after,
.tool-list [data-tool-tone="pc"]::after {
  display: none;
}

.tool-list [data-tool-tone="gold"] img,
.tool-list [data-tool-tone="cream"] img,
.tool-list [data-tool-tone="template"] img,
.tool-list [data-tool-tone="pc"] img {
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 14px;
}

.tool-list [data-tool-tone="gold"] strong,
.tool-list [data-tool-tone="cream"] strong,
.tool-list [data-tool-tone="template"] strong,
.tool-list [data-tool-tone="pc"] strong {
  margin-top: 0;
  font-size: 16px;
}

.tool-list [data-tool-tone="gold"] span,
.tool-list [data-tool-tone="cream"] span,
.tool-list [data-tool-tone="template"] span,
.tool-list [data-tool-tone="pc"] span {
  max-width: none;
  font-size: 11px;
  line-height: 1.28;
}


.tool-list [data-tool-tone="pc"] strong {
  color: #fff7df;
}

.tool-list [data-tool-tone="pc"] span {
  color: rgba(255, 236, 201, 0.76);
}
.tool-list [data-tool-tone="cream"] {
  margin-top: 0;
}

.external-ai-tools {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(114, 96, 80, 0.12);
}

.external-ai-tools-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.72fr);
  align-items: end;
  gap: 12px;
}

.external-ai-tools-heading span {
  color: #2d8b68;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.external-ai-tools-heading h2 {
  margin: 4px 0 0;
  color: #292b39;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.18;
}

.external-ai-tools-heading p {
  margin: 0;
  color: #82766c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
}

.external-ai-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.external-ai-tools-grid > button {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  min-height: 132px;
  padding: 13px;
  overflow: hidden;
  color: #2c2e3b;
  background:
    radial-gradient(circle at 100% 0%, rgba(118, 212, 176, 0.16), transparent 48%),
    rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: 0 12px 26px rgba(74, 58, 43, 0.08);
  text-align: left;
}

.external-ai-tools-grid > button::after {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 4px 7px;
  color: #237755;
  background: #e4f7ed;
  border: 1px solid rgba(87, 181, 139, 0.2);
  border-radius: 999px;
  content: "外部";
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.external-ai-tool-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  background: rgba(255, 248, 238, 0.94);
  border: 1px solid rgba(226, 206, 186, 0.56);
  border-radius: 14px;
}

.external-ai-tool-icon img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.external-ai-tool-copy {
  display: grid;
  grid-column: 1 / -1;
  gap: 3px;
  min-width: 0;
}

.external-ai-tool-copy small {
  overflow: hidden;
  color: #84776c;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-ai-tool-copy strong {
  min-height: 35px;
  color: #292b38;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
}

.external-ai-tool-copy em {
  color: #2d8b68;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.3;
}

.external-ai-tools-grid > button > b {
  position: absolute;
  right: 11px;
  bottom: 11px;
  color: #8c673f;
  font-size: 9px;
  font-weight: 900;
}

.external-ai-tools-grid > button[data-external-ai-kind="video"],
.external-ai-tools-grid > button[data-external-ai-kind="create"] {
  background:
    radial-gradient(circle at 100% 0%, rgba(191, 166, 255, 0.2), transparent 48%),
    rgba(255, 255, 255, 0.92);
}

.external-ai-tools-grid > button[data-external-ai-kind="audio"] {
  background:
    radial-gradient(circle at 100% 0%, rgba(143, 200, 255, 0.2), transparent 48%),
    rgba(255, 255, 255, 0.92);
}

.external-ai-tools-grid > button[data-external-ai-kind="poster"] {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 190, 101, 0.22), transparent 48%),
    rgba(255, 255, 255, 0.92);
}

.external-ai-tools-note {
  margin: 0;
  color: #82766c;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.55;
}

.external-ai-tools-note span {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 7px;
  color: #237755;
  background: #e4f7ed;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.external-ai-tools-grid > button:focus-visible {
  outline: 3px solid rgba(45, 139, 104, 0.3);
  outline-offset: 2px;
}

.external-ai-tools-grid > button:active {
  transform: scale(0.985);
}

.external-ai-tool-dialog {
  width: min(calc(100% - 20px), 410px);
  max-width: 410px;
  margin: auto auto 8px;
  padding: 0;
  overflow: visible;
  color: #35251d;
  background: transparent;
  border: 0;
}

.external-ai-tool-dialog::backdrop {
  background: rgba(44, 31, 22, 0.46);
  backdrop-filter: blur(5px);
}

.external-ai-tool-dialog > article {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  background: #fffaf4;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(61, 40, 24, 0.26);
}

.external-ai-tool-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 32px;
  padding: 0 11px;
  color: #776c63;
  background: #f5ece3;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.external-ai-tool-dialog header {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding-right: 52px;
}

.external-ai-tool-dialog-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: #247957;
  background: #dff5e9;
  border: 1px solid #bfe6d3;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.external-ai-tool-dialog header small {
  color: #2d8b68;
  font-size: 10px;
  font-weight: 900;
}

.external-ai-tool-dialog header h2 {
  margin: 3px 0 0;
  color: #352116;
  font-size: 21px;
  font-weight: 950;
  line-height: 1.2;
}

.external-ai-tool-dialog header p {
  margin: 4px 0 0;
  color: #7c6f66;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.4;
}

.external-ai-tool-dialog-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid #ede1d7;
  border-radius: 18px;
}

.external-ai-tool-dialog-body > p {
  margin: 0;
  color: #49372c;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.55;
}

.external-ai-tool-dialog-body ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.external-ai-tool-dialog-body li {
  position: relative;
  padding-left: 16px;
  color: #776a61;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
}

.external-ai-tool-dialog-body li::before {
  position: absolute;
  top: 0.58em;
  left: 2px;
  width: 5px;
  height: 5px;
  background: #58b48a;
  border-radius: 50%;
  content: "";
}

.external-ai-tool-dialog-compatibility {
  justify-self: center;
  min-height: 36px;
  padding: 0 12px;
  color: #287b5d;
  background: transparent;
  border: 1px solid rgba(45, 139, 104, 0.24);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
}

.external-ai-tool-dialog-compatibility:focus-visible {
  outline: 3px solid rgba(45, 139, 104, 0.28);
  outline-offset: 2px;
}

.external-ai-tool-dialog footer {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 9px;
}

.external-ai-tool-dialog footer button {
  min-height: 46px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 900;
}

.external-ai-tool-dialog footer button:first-child {
  color: #75685f;
  background: #f3eae2;
}

.external-ai-tool-dialog footer button:last-child {
  color: #fff;
  background: #2d8b68;
  box-shadow: 0 10px 22px rgba(45, 139, 104, 0.24);
}

.external-ai-tool-dialog footer button:focus-visible,
.external-ai-tool-dialog-close:focus-visible {
  outline: 3px solid rgba(45, 139, 104, 0.28);
  outline-offset: 2px;
}

.creator-screen {
  background:
    linear-gradient(180deg, #fff8ef 0%, #fff2e4 48%, #f6e7d8 100%);
}

.creator-header {
  background: rgba(255, 248, 238, 0.92);
  backdrop-filter: blur(18px);
}

.creator-content {
  display: grid;
  gap: 14px;
}

.creator-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: center;
  min-height: 164px;
  overflow: hidden;
  padding: 20px;
  color: #242838;
  border-radius: 30px;
  box-shadow: var(--shadow-card);
}

.creator-hero-image {
  background: linear-gradient(145deg, rgba(232, 255, 246, 0.98), rgba(204, 244, 227, 0.92));
}

.creator-hero-video {
  background: linear-gradient(145deg, rgba(248, 244, 255, 0.98), rgba(231, 222, 255, 0.92));
}

.creator-hero span {
  display: block;
  color: var(--color-brand-strong, #a94808);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.creator-hero h2 {
  max-width: 210px;
  margin: 8px 0 0;
  font-size: 25px;
  font-weight: 950;
  line-height: 1.14;
}

.creator-hero p {
  max-width: 220px;
  margin: 10px 0 0;
  color: rgba(49, 54, 69, 0.72);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.creator-hero img {
  width: 118px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(74, 58, 43, 0.16));
}

.creator-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(18px);
}

.creator-panel label {
  color: #242838;
  font-size: 15px;
  font-weight: 950;
}

.creator-panel textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 13px 14px;
  color: #343847;
  background: rgba(255, 250, 244, 0.9);
  border: 1px solid rgba(232, 214, 191, 0.82);
  border-radius: 18px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.creator-preset-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.creator-preset-row button {
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  overflow: hidden;
  color: #8f5e21;
  background: rgba(255, 247, 235, 0.92);
  border: 1px solid rgba(236, 205, 164, 0.72);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.creator-actions button {
  min-height: 52px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 950;
}

.creator-actions .secondary {
  color: #725f4d;
  background: rgba(255, 249, 241, 0.92);
  border: 1px solid rgba(232, 214, 191, 0.86);
}

.creator-actions .primary {
  color: #fff;
  background: linear-gradient(135deg, #bd520c, #a94808);
  box-shadow: 0 16px 30px rgba(169, 72, 8, 0.24);
}

.creator-generation {
  margin-bottom: 8px;
}

.profile-insights button {
  text-align: left;
}

.profile-insights strong {
  display: block;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.22;
}

.settings-list {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 28px;
}

.settings-head {
  display: grid;
  gap: 5px;
  margin-bottom: 2px;
}

.settings-list label {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  background: rgba(255, 250, 244, 0.78);
  border: 1px solid rgba(232, 214, 191, 0.68);
  border-radius: 18px;
}

.settings-list label span {
  color: #3a3e4f;
  font-size: 13px;
  font-weight: 900;
}

.settings-list input,
.settings-list select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  color: #343847;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(229, 211, 191, 0.82);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 750;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 116px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.profile-actions button {
  width: 100%;
  min-height: 50px;
  border-radius: 17px;
}

.bottom-nav {
  position: fixed;
  right: 16px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 42;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: min(calc(100% - 32px), 418px);
  min-height: var(--nav-height);
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(225, 211, 197, 0.82);
  border-radius: 28px;
  box-shadow: 0 -12px 36px rgba(87, 61, 35, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.98);
  transform: translateX(-50%);
  backdrop-filter: blur(22px);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  padding: 4px 2px;
  color: #8b8c93;
  background: transparent;
  border-radius: 20px;
}

.bottom-nav img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  filter: grayscale(0.15) saturate(0.85);
  opacity: 0.72;
}

.bottom-nav [data-open-screen="assistant"] img {
  width: 25px;
  height: 25px;
}

.bottom-nav span {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav button.is-active {
  color: #ed7b24;
  background: linear-gradient(180deg, rgba(255, 246, 235, 0.96), rgba(255, 255, 255, 0.78));
  box-shadow: inset 0 0 0 1px rgba(238, 158, 72, 0.16);
}

.bottom-nav button.is-active img {
  filter: none;
  opacity: 1;
}

body.is-modal-open .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(120%);
}

body.is-modal-open .composer {
  opacity: 0;
  pointer-events: none;
}

.work-detail-shell,
.copy-fallback-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
}

.work-detail-backdrop,
.copy-fallback-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  background: rgba(34, 28, 23, 0.38);
  backdrop-filter: blur(8px);
}

.work-detail-panel,
.copy-fallback-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  max-height: min(84dvh, 760px);
  margin: 0 auto;
  overflow: auto;
  background: #fffaf3;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -20px 60px rgba(49, 36, 24, 0.28);
}

.work-detail-handle {
  width: 44px;
  height: 5px;
  margin: 10px auto 0;
  background: rgba(88, 76, 66, 0.24);
  border-radius: 999px;
}

.work-detail-content,
.copy-fallback-panel {
  display: grid;
  gap: 14px;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
}

.work-detail-head,
.copy-fallback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-detail-head h2,
.copy-fallback-head h2 {
  margin: 6px 0 0;
  color: #222638;
  font-size: 23px;
  font-weight: 950;
  line-height: 1.18;
}

.work-detail-head p {
  margin: 6px 0 0;
  color: #8f8d94;
  font-size: 12px;
  font-weight: 750;
}

.work-detail-head button,
.copy-fallback-head button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  color: #8a5b20;
  background: rgba(255, 247, 235, 0.92);
  border: 1px solid rgba(236, 205, 164, 0.72);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.work-detail-preview {
  display: grid;
  gap: 10px;
}

.work-detail-body {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(232, 214, 191, 0.72);
  border-radius: 20px;
}

.work-detail-body span {
  color: #bf701c;
  font-size: 11px;
  font-weight: 950;
}

.work-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-detail-actions .destructive {
  color: #a63f35;
  background: #fff2ef;
  border-color: #efc5bf;
}

.copy-fallback-text {
  width: 100%;
  min-height: 240px;
  padding: 13px;
  resize: vertical;
  color: #343847;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(232, 214, 191, 0.76);
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.58;
}

.is-native-shell .status-row {
  display: none;
}

@media (max-width: 390px) {
  :root {
    --nav-height: 74px;
  }

  .home-hero {
    min-height: 476px;
    padding-inline: 18px;
  }

  .member-pill {
    right: 16px;
  }

  .brand-lockup {
    width: 62%;
    margin-top: 42px;
  }

  .brand-lockup h1 {
    font-size: 48px;
  }

  .brand-lockup p {
    max-width: 236px;
    font-size: 18px;
  }

  .hero-pet {
    top: calc(82px + env(safe-area-inset-top));
    right: -54px;
    width: 304px;
    height: 374px;
  }

  .home-hero::before {
    left: 128px;
    bottom: 58px;
    width: 118px;
    height: 118px;
  }

  .hero-note {
    top: calc(214px + env(safe-area-inset-top));
    left: 35px;
    width: 146px;
    font-size: 16px;
  }

  .home-content {
    gap: 12px;
    margin-top: -146px;
    padding-inline: 14px;
  }

  .home-prompt-panel {
    padding: 14px;
  }

  .home-prompt-head h2 {
    font-size: 23px;
  }

  .home-prompt-chips {
    gap: 8px;
  }

  .home-prompt-chips button {
    padding-inline: 8px;
    font-size: 12px;
  }

  .feature-grid {
    gap: 8px;
  }

  .feature-card {
    min-height: 150px;
    height: 150px;
    padding: 13px 10px 63px;
    border-radius: 24px;
  }

  .feature-title {
    font-size: 17px;
  }

  .feature-copy {
    min-height: 36px;
    font-size: 11px;
    line-height: 1.38;
  }

  .feature-thumb {
    bottom: 10px;
    left: 10px;
    width: 44px;
    height: 42px;
  }

  .feature-purple .feature-thumb {
    bottom: 10px;
    left: 10px;
    width: 40px;
    height: 44px;
  }

  .feature-green .robot-thumb {
    bottom: 10px;
    left: 8px;
    width: 46px;
    height: 42px;
  }

  .feature-icon {
    right: 8px;
    bottom: 9px;
    width: 32px;
    height: 32px;
  }

  .case-strip {
    grid-auto-columns: minmax(70px, 1fr);
    gap: 9px;
  }

  .assistant-intro div {
    margin-left: 126px;
  }

  .assistant-intro img {
    left: -58px;
    width: 226px;
  }

  .tool-spotlight {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .tool-spotlight::after {
    width: 96px;
    height: 126px;
  }
}

@media (max-width: 360px) {
  :root {
    --nav-height: 72px;
  }

  .home-hero {
    min-height: 462px;
    padding-inline: 15px;
  }

  .member-pill {
    top: calc(34px + env(safe-area-inset-top));
    right: 12px;
    padding-right: 12px;
  }

  .member-pill span {
    font-size: 12px;
  }

  .brand-lockup {
    width: 64%;
    margin-top: 38px;
  }

  .brand-lockup h1 {
    font-size: 45px;
  }

  .brand-lockup p {
    max-width: 204px;
    font-size: 16px;
  }

  .hero-pet {
    top: calc(84px + env(safe-area-inset-top));
    right: -66px;
    width: 286px;
    height: 356px;
  }

  .home-hero::before {
    left: 108px;
    bottom: 54px;
    width: 108px;
    height: 108px;
  }

  .hero-note {
    top: calc(208px + env(safe-area-inset-top));
    left: 25px;
    width: 144px;
    padding: 15px 15px 28px;
    border-radius: 24px;
    font-size: 16px;
  }

  .home-content {
    gap: 13px;
    margin-top: -132px;
    padding-inline: 12px;
  }

  .home-prompt-panel {
    padding: 15px;
    border-radius: 26px;
  }

  .home-prompt-head h2 {
    font-size: 21px;
  }

  .home-prompt-head button {
    font-size: 12px;
  }

  .home-prompt-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-prompt-chips button {
    font-size: 12px;
  }

  .feature-grid {
    gap: 8px;
  }

  .feature-card {
    min-height: 144px;
    height: 144px;
    padding: 12px 9px 59px;
    border-radius: 22px;
  }

  .feature-title {
    font-size: 16px;
  }

  .feature-copy {
    min-height: 34px;
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.36;
  }

  .feature-thumb {
    right: auto;
    bottom: 9px;
    left: 9px;
    width: 39px;
    height: 38px;
  }

  .feature-purple .feature-thumb {
    right: auto;
    bottom: 9px;
    left: 9px;
    width: 37px;
    height: 40px;
  }

  .feature-green .robot-thumb {
    right: auto;
    bottom: 9px;
    left: 8px;
    width: 41px;
    height: 38px;
  }

  .feature-icon {
    right: 8px;
    bottom: 8px;
    width: 30px;
    height: 30px;
  }

  .feature-grid + .content-card,
  .app-screen-home .assistant-bridge + .content-card {
    margin-top: 0;
  }

  .assistant-bridge {
    grid-template-columns: 50px minmax(0, 1fr) 58px;
    gap: 9px;
    padding: 11px;
  }

  .assistant-bridge img {
    width: 50px;
    height: 50px;
  }

  .assistant-bridge strong {
    font-size: 11.5px;
  }

  .content-card {
    padding: 15px;
    border-radius: 26px;
  }

  .section-head h2,
  .assistant-block h2,
  .generation-head h2 {
    font-size: 20px;
  }

  .case-strip {
    grid-auto-columns: 80px;
  }

  .case-strip strong {
    font-size: 11px;
  }

  .case-strip span {
    font-size: 11px;
  }

  .template-grid {
    gap: 8px;
  }

  .template-grid button,
  .template-grid img {
    min-height: 124px;
  }

  .template-center-hero {
    grid-template-columns: minmax(0, 1fr) 96px;
    min-height: 154px;
    padding: 17px 14px;
  }

  .template-center-hero h2 {
    max-width: 190px;
    font-size: 23px;
  }

  .template-center-hero p {
    max-width: 192px;
    font-size: 12px;
  }

  .template-center-hero img {
    width: 96px;
    height: 106px;
    border-radius: 24px;
  }

  .template-library-card {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 21px;
  }

  .template-library-media img {
    height: 128px;
    border-radius: 16px;
  }

  .template-library-body h3 {
    font-size: 16px;
  }

  .template-library-body p {
    min-height: 38px;
    font-size: 11px;
    line-height: 1.35;
  }

  .template-library-actions {
    gap: 6px;
  }

  .template-library-actions button {
    min-height: 34px;
    padding-inline: 5px;
    font-size: 11px;
  }

  .assistant-hero {
    min-height: 374px;
    padding-inline: 14px;
  }

  .assistant-topbar {
    grid-template-columns: 44px minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .assistant-topbar h1 {
    font-size: 18px;
  }

  .assistant-topbar .member-pill span {
    display: none;
  }

  .assistant-topbar .member-pill.compact {
    justify-self: end;
    width: 48px;
    min-width: 48px;
    min-height: 44px;
    padding: 4px;
    gap: 0;
    border-radius: 16px;
  }

  .assistant-topbar .member-pill.compact img {
    width: 28px;
    height: 28px;
  }

  .assistant-intro {
    min-height: 206px;
  }

  .assistant-intro img {
    left: -66px;
    width: 214px;
  }

  .assistant-intro div {
    margin-left: 112px;
    padding: 18px 14px;
  }

  .assistant-intro p {
    font-size: 18px;
  }

  .assistant-intro span {
    font-size: 12px;
  }

  .user-bubble {
    grid-template-columns: minmax(0, 1fr) 56px;
    max-width: 292px;
    padding: 11px 10px 11px 14px;
  }

  .user-bubble img {
    width: 54px;
    height: 42px;
  }

  .assistant-content {
    margin-top: -46px;
    padding-inline: 12px;
  }

  .reply-card,
  .assistant-block,
  .generation-panel {
    gap: 10px;
    padding: 13px;
    border-radius: 24px;
  }

  .prompt-card {
    gap: 8px;
    padding: 10px;
  }

  #assistantPrompt {
    display: block;
    max-height: none;
    overflow: visible;
    font-size: 11px;
    line-height: 1.24;
    -webkit-box-orient: initial;
    -webkit-line-clamp: initial;
  }

  .generation-result-card,
  .generation-progress-card {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .generation-result-card img,
  .generation-progress-visual img {
    width: 70px;
    height: 94px;
  }

  .generation-progress-steps {
    gap: 6px;
  }

  .generation-progress-steps li {
    min-height: 44px;
    padding-inline: 4px;
    font-size: 10px;
  }

  .screen-content {
    padding-inline: 12px;
  }

  .screen-header {
    padding-inline: 12px;
  }

  .screen-header h1 {
    font-size: 27px;
  }

  .tool-spotlight {
    grid-template-columns: minmax(0, 1fr) 92px;
    min-height: 168px;
    padding: 18px 14px;
  }

  .tool-spotlight::after {
    right: 10px;
    width: 86px;
    height: 116px;
  }

  .tool-spotlight h2 {
    max-width: 172px;
    font-size: 24px;
  }

  .tool-list {
    gap: 8px;
    margin-top: -5px;
  }

  .tool-list button,
  .tool-list a {
    min-height: 122px;
    padding: 14px 12px;
  }

  .tool-list strong {
    font-size: 17px;
  }

  .tool-list span {
    max-width: 88px;
    font-size: 12px;
  }

  .settings-list label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #profileScreen .settings-list label:nth-of-type(n + 3) {
    margin-top: 132px;
  }

  .bottom-nav {
    width: min(calc(100% - 24px), 418px);
    padding: 7px 7px;
    border-radius: 27px;
  }

  .bottom-nav button {
    min-height: 56px;
  }

  .bottom-nav img {
    width: 23px;
    height: 23px;
  }

  .bottom-nav span {
    font-size: 10px;
  }

  .composer {
    width: min(calc(100% - 24px), 402px);
    bottom: calc(var(--nav-height) + 6px + env(safe-area-inset-bottom));
  }

  .assistant-feature-toolbar {
    width: min(calc(100% - 24px), 402px);
    bottom: calc(var(--nav-height) + 76px + env(safe-area-inset-bottom));
  }
}

/* v54 assistant reply reflow */
.phone-app.has-assistant-reply .assistant-hero {
  min-height: auto;
  overflow: visible;
  padding-bottom: 14px;
}

.phone-app.has-assistant-reply .assistant-hero::after,
.phone-app.has-assistant-reply .assistant-intro,
.phone-app.has-assistant-reply .user-bubble {
  display: none;
}

.phone-app.has-assistant-reply .assistant-content {
  margin-top: 0;
  display: flex;
  min-height: calc(100dvh - var(--nav-height) + 20px);
  flex-direction: column;
  justify-content: flex-end;
  justify-content: safe flex-end;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: calc(var(--nav-height) + 258px + env(safe-area-inset-bottom));
}

.reply-card,
.generation-panel {
  scroll-margin-bottom: calc(var(--nav-height) + 178px + env(safe-area-inset-bottom));
}

.phone-app.has-assistant-reply .reply-card {
  margin-top: 14px;
}

@media (max-width: 390px) {
  .phone-app.has-assistant-reply .assistant-content {
    margin-top: 0;
  }
}
/* v51 first assistant block gap override */
.phone-app.has-assistant-reply .assistant-content > .assistant-block:first-of-type {
  margin-top: 0;
}
/* v52 assistant block margin hard override */
.phone-app.has-assistant-reply .assistant-content > .assistant-block {
  margin-top: 0 !important;
}
/* v53 visible user message */
/* v54 sent message card */
.sent-message-card {
  display: none;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-self: end;
  width: fit-content;
  max-width: min(78%, 320px);
  margin-left: auto;
  gap: 0;
  scroll-margin-top: 18px;
  padding: 11px 15px;
  color: #fff;
  background: linear-gradient(135deg, #ff9b2f, #f1861f);
  border-radius: 20px 20px 7px 20px;
  box-shadow: 0 16px 26px rgba(218, 117, 31, 0.18);
}

.sent-message-card strong {
  display: none;
}

.sent-message-card p {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.phone-app.has-assistant-reply .sent-message-card {
  display: grid;
  margin-top: 0;
  margin-bottom: 0;
}

.assistant-chat-log {
  display: grid;
  gap: 14px;
}

.assistant-chat-turn {
  display: grid;
  gap: 10px;
  opacity: 0.82;
}

.assistant-chat-log .sent-message-card {
  display: grid;
}

.assistant-chat-log .reply-card {
  display: grid;
  margin-top: 0;
}

.assistant-chat-log .generation-panel {
  display: grid;
  gap: 10px;
}

.assistant-chat-log .agent-status {
  display: none;
}

.assistant-image-progress {
  display: grid;
  gap: 6px;
  padding: 14px;
  color: #167156;
  background: linear-gradient(135deg, rgba(220, 252, 238, 0.94), rgba(245, 255, 250, 0.96));
  border: 1px solid rgba(92, 205, 159, 0.46);
  border-radius: 18px;
}

.assistant-image-progress strong {
  font-size: 15px;
}

.assistant-image-progress p {
  margin: 0;
  color: #40705f;
  font-size: 12px;
  line-height: 1.55;
}

#assistantScreen .reply-card {
  display: none;
}

.phone-app.has-assistant-reply #assistantScreen .reply-card {
  display: grid;
  margin-top: 0;
}

.phone-app.has-assistant-reply #assistantScreen .assistant-block {
  display: none;
}

.phone-app.has-assistant-reply #assistantScreen .agent-mode-switch,
.phone-app.has-assistant-reply #assistantScreen .action-grid {
  display: none;
}

/* v88 reference-led homepage */
.app-screen-home {
  background: #fffaf4;
}

.app-screen-home .home-hero {
  min-height: 0;
  padding: calc(12px + env(safe-area-inset-top)) 14px 0;
  overflow: visible;
  background: transparent;
}

.app-screen-home .home-hero::before,
.app-screen-home .home-hero::after,
.app-screen-home .home-prompt-panel::after,
.app-screen-home .section-head::after,
.app-screen-home .section-head > button::after {
  display: none;
}

.home-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 0 5px;
}

.home-brand-lockup {
  min-width: 0;
}

.home-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-brand-title strong {
  color: #35180b;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
  white-space: nowrap;
}

.home-brand-title img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  filter: saturate(1.35) contrast(1.05);
}

.home-brand-lockup p {
  margin: 5px 0 0;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.home-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.home-alert-button,
.home-avatar-button {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  background: #fffaf2;
  border: 1px solid #f1dfc7;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(103, 69, 36, 0.1);
}

.home-alert-button img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: none;
}

.home-avatar-button {
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #f3c36b, 0 8px 18px rgba(103, 69, 36, 0.12);
}

.home-avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-showcase {
  position: relative;
  min-height: 184px;
  margin-top: 10px;
  overflow: hidden;
  background: #ffd661 url("./assets/pet-mobile-home-hero-robot-v2.webp") center / cover no-repeat;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 28px;
  box-shadow: 0 14px 28px rgba(187, 112, 16, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.home-showcase-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: start;
  width: 62%;
  min-height: 184px;
  padding: 15px 0 13px 19px;
}

.home-showcase-copy > span {
  color: #49200d;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.home-showcase-copy h1 {
  max-width: 210px;
  margin: 5px 0 0;
  color: #35170a;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.8px;
}

.home-showcase-copy h1 em {
  color: #ff6f00;
  font-style: normal;
}

.home-showcase-copy p {
  max-width: 192px;
  margin: 6px 0 0;
  color: #684525;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.home-showcase-copy button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  min-height: 39px;
  margin-top: 9px;
  padding: 0 15px;
  color: #fff;
  background: linear-gradient(135deg, #bd520c, #a94808);
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(191, 86, 8, 0.24);
  font-size: 14px;
  font-weight: 600;
}

.home-showcase-copy button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: none;
}

.app-screen-home .home-content {
  z-index: 3;
  gap: 12px;
  margin-top: 0;
  padding: 12px 14px calc(var(--nav-height) + 28px + env(safe-area-inset-bottom));
}

.home-quick-prompt {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 5px 7px 5px 13px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #f0e2d2;
  border-radius: 21px;
  box-shadow: 0 9px 20px rgba(104, 68, 33, 0.09);
}

.home-quick-prompt > img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.46;
}

.home-quick-prompt input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  color: #3f2b1d;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
  font-weight: 500;
}

.home-quick-prompt input::placeholder {
  color: var(--color-text-subtle, #7a6d64);
  opacity: 1;
}

.home-quick-prompt input[aria-invalid="true"]::placeholder {
  color: #d86748;
}

.home-quick-prompt button {
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  background: #ffb914;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 8px 16px rgba(207, 132, 12, 0.2);
}

.home-quick-prompt button img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  filter: none;
}

.home-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.home-action-grid > :is(button, a) {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 94px;
  padding: 6px 3px 7px;
  background: #fff;
  border: 1px solid #f1e4d7;
  border-radius: 19px;
  box-shadow: 0 8px 18px rgba(98, 62, 28, 0.065);
  color: inherit;
  text-decoration: none;
}

.home-action-art {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  background: #fff3df;
  border-radius: 15px;
}

.home-action-art.tone-purple,
.home-action-art.tone-warm { background: #ffe5bd; }
.home-action-art.tone-blue { background: #edf4ff; }
.home-action-art.tone-rose { background: #fff0f1; }
.home-action-art.tone-green { background: #edf8ec; }
.home-action-art.tone-orange { background: #fff2e3; }

.home-action-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-action-grid strong {
  max-width: 100%;
  overflow: hidden;
  color: #31231b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-action-grid small {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-prompt-tool-entry {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 11px;
  min-height: 88px;
  padding: 12px 14px 12px 12px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 224, 128, 0.3), transparent 34%),
    linear-gradient(118deg, #a94b17 0%, #df741e 48%, #f5a612 100%);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 23px;
  box-shadow: 0 12px 25px rgba(153, 77, 19, 0.2);
  isolation: isolate;
}

.home-prompt-tool-entry::after {
  position: absolute;
  right: -21px;
  bottom: -37px;
  z-index: -1;
  width: 118px;
  height: 118px;
  border: 22px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
}

.home-prompt-tool-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  align-self: center;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  box-shadow: 0 7px 16px rgba(95, 46, 12, 0.2);
}

.home-prompt-tool-icon img {
  width: 52px;
  height: 46px;
  object-fit: contain;
}

.home-prompt-tool-copy {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.home-prompt-tool-copy small {
  color: #ffe5ad;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.home-prompt-tool-copy strong {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.home-prompt-tool-copy span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-prompt-tool-entry > b {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 30px;
  align-self: center;
  color: #94420f;
  background: #fff4d7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.home-prompt-tool-entry:focus-visible {
  outline: 3px solid #c7651d;
  outline-offset: 3px;
}

.home-prompt-tool-entry:active {
  transform: scale(0.985);
}

@media (max-width: 360px) {
  .home-prompt-tool-entry {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 9px;
    padding-inline: 10px;
  }

  .home-prompt-tool-icon {
    width: 52px;
    height: 52px;
  }

  .home-prompt-tool-copy span {
    display: none;
  }
}

.app-screen-home .content-card,
.home-recent-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.app-screen-home .section-head {
  min-height: 28px;
  padding: 0 3px;
}

.app-screen-home .section-head > div {
  gap: 7px;
}

.app-screen-home .section-head img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: none;
}

.app-screen-home .section-head h2 {
  color: #382116;
  font-size: 19px;
  font-weight: 700;
}

.app-screen-home .section-head > button {
  min-height: 32px;
  padding: 0 4px;
  color: #7c746e;
  font-size: 13px;
  font-weight: 600;
}

.app-screen-home .case-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 8px;
  padding: 0;
  overflow: visible;
}

.app-screen-home .case-strip button {
  height: 96px;
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 11px 20px rgba(70, 45, 22, 0.11);
}

.app-screen-home .case-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: none;
}

.app-screen-home .case-strip strong {
  right: 6px;
  bottom: 6px;
  left: 6px;
  padding: 6px 4px;
  background: rgba(44, 28, 17, 0.48);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
}

.home-recent-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  min-height: 78px;
}

.home-recent-card,
.home-recent-create {
  position: relative;
  min-width: 0;
  min-height: 78px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  border: 1px solid #eee1d2;
  border-radius: 16px;
  box-shadow: 0 8px 17px rgba(72, 47, 25, 0.08);
}

.home-recent-card img,
.home-recent-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-recent-card span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}

.home-recent-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  grid-column: span 5;
  align-content: center;
  align-items: center;
  column-gap: 12px;
  min-width: 0;
  min-height: 80px;
  padding: 11px 12px 11px 14px;
  color: #85796f;
  background: #fff;
  border: 1px solid #eee1d2;
  border-radius: 16px;
}

.home-recent-empty strong {
  color: #453126;
  font-size: 13px;
  font-weight: 600;
}

.home-recent-empty span {
  grid-column: 1;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-empty button {
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: 44px;
  padding-inline: 14px;
  border-radius: 999px;
}

.home-recent-create {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #9b8f85;
  background: #fbf7f1;
}

.home-recent-create img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  opacity: 0.55;
}

.home-recent-create span {
  font-size: 12px;
  font-weight: 600;
}

.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 430px);
  min-height: 72px;
  bottom: 0;
  padding: 6px 7px calc(5px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.985);
  border: 1px solid rgba(231, 219, 205, 0.88);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -14px 32px rgba(82, 52, 24, 0.13);
}

.bottom-nav button {
  min-height: 54px;
  border-radius: 18px;
}

.bottom-nav img,
.bottom-nav [data-open-screen="assistant"] img {
  width: 23px;
  height: 23px;
}

.bottom-nav button:not(.assistant-nav-button) img {
  mix-blend-mode: normal;
  filter: grayscale(0.25) saturate(0.78);
  opacity: 0.72;
}

.bottom-nav button.is-active:not(.assistant-nav-button) img {
  filter: sepia(1) saturate(6) hue-rotate(344deg) brightness(0.96);
  opacity: 1;
}

.bottom-nav span {
  color: inherit;
  font-size: 10px;
  font-weight: 850;
}

.bottom-nav button.is-active {
  color: #ff6f00;
  background: transparent;
  box-shadow: none;
}

.bottom-nav .assistant-nav-button {
  position: relative;
  align-content: end;
  height: 54px;
  min-height: 54px;
  overflow: visible;
  padding-bottom: 3px;
  transform: none;
}

.bottom-nav .assistant-nav-button img {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 48px;
  height: 48px;
  padding: 3px;
  object-fit: cover;
  object-position: 76% 34%;
  background: #f4eee7;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #e5d8cb, 0 8px 18px rgba(82, 52, 24, 0.14);
  filter: saturate(0.72);
  opacity: 0.9;
  transform: translateX(-50%);
  transition:
    top 180ms ease,
    width 180ms ease,
    height 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.bottom-nav .assistant-nav-button span {
  margin-top: 0;
  color: #352419;
  font-size: 11px;
  font-weight: 950;
}

@media (max-width: 360px) {
  .app-screen-home .home-hero {
    padding-inline: 12px;
  }

  .home-brand-title strong {
    font-size: 27px;
  }

  .home-brand-lockup p {
    font-size: 12px;
  }

  .home-header-actions {
    gap: 7px;
  }

  .home-alert-button,
  .home-avatar-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .home-showcase,
  .home-showcase-copy {
    min-height: 178px;
  }

  .home-showcase-copy {
    width: 58%;
    padding-left: 18px;
  }

  .home-showcase-copy h1 {
    max-width: 164px;
    font-size: 24px;
  }

  .home-showcase-copy p {
    max-width: 172px;
    font-size: 12px;
  }

  .app-screen-home .home-content {
    gap: 11px;
    padding-inline: 12px;
  }

  .home-quick-prompt {
    grid-template-columns: 27px minmax(0, 1fr) 46px;
    gap: 7px;
    padding-left: 12px;
  }

  .home-quick-prompt input {
    font-size: 16px;
  }

  .home-action-grid {
    gap: 6px;
  }

  .home-action-grid > :is(button, a) {
    min-height: 90px;
    border-radius: 19px;
  }

  .home-action-art {
    width: 47px;
    height: 47px;
  }

  .home-action-art img {
    width: 39px;
    height: 39px;
  }

  .home-action-grid strong {
    font-size: 11px;
  }

  .home-action-grid small {
    font-size: 12px;
  }

  .app-screen-home .case-strip button {
    height: 100px;
  }

  .home-recent-grid {
    gap: 6px;
  }
}

@media (max-width: 370px) {
  .templates-screen .template-center-hero {
    grid-template-columns: minmax(0, 1fr) 88px;
    min-height: 160px;
    padding: 15px;
    border-radius: 16px;
  }

  .templates-screen .template-center-hero img {
    width: 88px;
    height: 116px;
    border-radius: 12px;
  }

  .templates-screen .template-library-card {
    display: block;
    padding: 0;
    border-radius: 14px;
  }

  .templates-screen .template-library-media img {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .templates-screen .template-library-actions button,
  .templates-screen .template-library-actions button:first-child {
    min-height: 44px;
    padding-inline: 4px;
    font-size: 12px;
  }
}

/* v90 assistant cascade lock */
#assistantScreen {
  background: #fffaf4;
}

#assistantScreen .assistant-hero,
.phone-app.has-assistant-reply #assistantScreen .assistant-hero {
  min-height: 0;
  padding: calc(12px + env(safe-area-inset-top)) 14px 0;
  overflow: visible;
  background: #fffaf4;
}

#assistantScreen .assistant-hero::after,
.phone-app.has-assistant-reply #assistantScreen .assistant-hero::after {
  display: none;
}

#assistantScreen .assistant-feature-toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 37%;
  z-index: 5;
  display: block;
  width: auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  backdrop-filter: none;
}

#assistantScreen:not(.is-active) .assistant-feature-toolbar {
  display: none;
}

#assistantScreen .assistant-feature-scroll {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  overflow: visible;
}

#assistantScreen .assistant-feature-scroll button {
  display: grid;
  min-width: 0;
  min-height: 76px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 7px 3px 6px;
  color: #503522;
  background: rgba(255, 251, 239, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 17px;
  box-shadow: 0 8px 17px rgba(130, 78, 19, 0.1);
}

#assistantScreen .assistant-feature-scroll button.is-active {
  color: #bf630f;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 2px rgba(255, 150, 24, 0.18), 0 8px 17px rgba(130, 78, 19, 0.11);
}

#assistantScreen .assistant-feature-scroll img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 9px;
}

#assistantScreen .assistant-feature-scroll span {
  max-width: 100%;
  overflow: hidden;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
}

#assistantScreen .assistant-image-progress.is-stopped {
  color: #a5541e;
  background: linear-gradient(135deg, rgba(255, 241, 229, 0.96), rgba(255, 249, 242, 0.98));
  border-color: rgba(230, 146, 87, 0.48);
}

#assistantScreen .assistant-image-progress.is-stopped p {
  color: #8b6044;
}

#assistantScreen .assistant-mode-popover {
  position: absolute;
  right: 13px;
  bottom: 93px;
  left: auto;
  width: 184px;
  transform: none;
}

#assistantScreen .assistant-content,
.phone-app.has-assistant-reply #assistantScreen .assistant-content {
  display: grid;
  min-height: 0;
  justify-content: stretch;
  gap: 12px;
  margin-top: 0;
  padding: 12px 14px calc(var(--nav-height) + 92px + env(safe-area-inset-bottom));
}

#assistantScreen .assistant-block {
  gap: 10px;
  margin-top: 0 !important;
  padding: 14px;
  background: rgba(255, 255, 255, 0.91);
  border: 1px solid #efe1d1;
  border-radius: 23px;
  box-shadow: 0 10px 22px rgba(99, 66, 34, 0.07);
}

#assistantScreen .sent-message-card {
  display: none;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: end;
  justify-self: end;
  gap: 8px;
  width: min(90%, 350px);
  max-width: none;
  margin: 0 0 0 auto;
  padding: 0;
  color: #442d1f;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.phone-app.has-assistant-reply #assistantScreen .sent-message-card,
#assistantScreen .assistant-chat-log .sent-message-card {
  display: grid;
}

#assistantScreen .sent-message-card > div {
  padding: 11px 14px;
  background: linear-gradient(135deg, #fff4cc, #ffe5a0);
  border: 1px solid rgba(247, 199, 94, 0.54);
  border-radius: 20px 20px 6px 20px;
  box-shadow: 0 10px 20px rgba(184, 118, 24, 0.1);
}

#assistantScreen .sent-message-card p {
  color: #442d1f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

#assistantScreen .sent-message-card > img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #efc669;
}

.phone-app.has-assistant-reply #assistantScreen .assistant-welcome-card,
.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .assistant-block {
  display: none;
}

#assistantScreen .reply-card,
#assistantScreen .assistant-chat-log .reply-card {
  display: none;
  gap: 8px;
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.phone-app.has-assistant-reply #assistantScreen .reply-card,
#assistantScreen .assistant-chat-log .reply-card {
  display: grid;
}

#assistantScreen .reply-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
}

#assistantScreen .reply-head p {
  margin: 0;
  padding: 11px 13px;
  color: #4d4036;
  background: #fff;
  border: 1px solid #eee1d4;
  border-radius: 7px 20px 20px 20px;
  box-shadow: 0 10px 20px rgba(80, 55, 31, 0.08);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

#assistantScreen .prompt-card {
  gap: 8px;
  margin-left: 55px;
  padding: 13px;
  background: linear-gradient(135deg, #fffaf0, #fff4d8);
  border: 1px solid #f0d8a5;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(148, 93, 24, 0.08);
}

#assistantScreen .generation-panel {
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #eee1d4;
  border-radius: 23px;
  box-shadow: 0 10px 22px rgba(80, 55, 31, 0.08);
}

#assistantScreen .generation-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

#assistantScreen .generation-actions button {
  min-height: 40px;
  padding: 0 6px;
  font-size: 9px;
}

#assistantScreen .action-grid,
.phone-app.has-assistant-reply #assistantScreen .action-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 0;
}

.phone-app.has-assistant-reply #assistantScreen .action-grid {
  display: grid;
}

#assistantScreen .action-grid button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 50px;
  align-items: center;
  gap: 5px;
  padding: 7px 6px;
  color: #4f3c2f;
  background: #fff;
  border: 1px solid #eee1d4;
  border-radius: 17px;
  box-shadow: 0 8px 17px rgba(80, 55, 31, 0.07);
}

#assistantScreen .action-grid img {
  width: 22px;
  height: 22px;
  padding: 0;
  object-fit: contain;
  background: transparent;
  border-radius: 7px;
}

#assistantScreen .action-grid span {
  font-size: 9px;
  line-height: 1.2;
  text-align: left;
}

#assistantScreen .composer {
  grid-template-columns: 42px minmax(0, 1fr) 46px;
  gap: 7px;
  width: min(calc(100% - 24px), 406px);
  min-height: 60px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #ecdfd1;
  border-radius: 27px;
  box-shadow: 0 -10px 30px rgba(78, 53, 29, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

#assistantScreen .composer input {
  min-height: 44px;
  padding: 0 12px;
  background: #fffaf5;
  border: 1px solid #ede1d5;
  border-radius: 19px;
  font-size: 13px;
}

#assistantScreen .voice-button,
#assistantScreen .send-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 17px;
}

#assistantScreen .send-button {
  width: 46px;
  min-width: 46px;
  background: #ffb917;
  box-shadow: 0 8px 16px rgba(206, 132, 12, 0.2);
}

#assistantScreen .voice-button::before,
#assistantScreen .voice-button::after,
#assistantScreen .send-button::before {
  display: none;
}

#assistantScreen .voice-button img,
#assistantScreen .send-button img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

@media (max-width: 360px) {
  #assistantScreen .assistant-hero {
    padding-inline: 12px;
  }

  #assistantScreen .assistant-feature-toolbar {
    right: 9px;
    bottom: 9px;
    left: 34%;
  }

  #assistantScreen .assistant-feature-scroll {
    gap: 4px;
  }

  #assistantScreen .assistant-feature-scroll button {
    min-height: 68px;
    border-radius: 14px;
  }

  #assistantScreen .assistant-feature-scroll img {
    width: 24px;
    height: 24px;
  }

  #assistantScreen .assistant-feature-scroll span {
    font-size: 7.5px;
  }

  #assistantScreen .assistant-content {
    padding-inline: 12px;
  }

  #assistantScreen .prompt-card {
    margin-left: 0;
  }

  #assistantScreen .action-grid button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 56px;
  }

  #assistantScreen .action-grid span {
    text-align: center;
  }
}

/* v91 assistant density refinement */
#assistantScreen .assistant-showcase {
  min-height: 188px;
}

#assistantScreen .assistant-showcase-copy {
  padding-top: 12px;
}

#assistantScreen .assistant-showcase-copy h1 {
  font-size: 25px;
}

#assistantScreen .assistant-showcase-copy p {
  margin-top: 4px;
  font-size: 8px;
}

#assistantScreen .assistant-feature-toolbar {
  bottom: 9px;
}

#assistantScreen .assistant-feature-scroll button {
  min-height: 64px;
  gap: 3px;
  padding-block: 5px;
  border-radius: 15px;
}

#assistantScreen .assistant-feature-scroll img {
  width: 24px;
  height: 24px;
}

#assistantScreen .assistant-mode-popover {
  bottom: 80px;
}

#assistantScreen .assistant-welcome-card {
  padding: 12px;
}

@media (max-width: 360px) {
  #assistantScreen .assistant-showcase {
    min-height: 178px;
  }

  #assistantScreen .assistant-feature-scroll button {
    min-height: 60px;
  }
}

/* v107 compact composer capability dock */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase {
  min-height: 132px;
  padding-bottom: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
  position: fixed;
  right: 12px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 40;
  display: grid;
  gap: 6px;
  width: min(calc(100% - 24px), 406px);
  transform: translateX(-50%);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-toolbar {
  position: static;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(225, 203, 175, 0.82);
  border-radius: 17px;
  box-shadow: 0 8px 22px rgba(91, 61, 31, 0.12);
  backdrop-filter: blur(18px);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-padding-inline: 5px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll::-webkit-scrollbar {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-options {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  color: #6b513d;
  background: #fffaf4;
  border: 1px solid #eadbc9;
  border-radius: 11px;
  box-shadow: none;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button.is-active,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-options button[aria-checked="true"] {
  color: #fff;
  background: #ff8a18;
  border-color: #ff8a18;
  box-shadow: 0 5px 12px rgba(215, 113, 13, 0.2);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  border-radius: 4px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button span {
  max-width: none;
  overflow: visible;
  font-size: 10px;
  text-overflow: clip;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll .assistant-add-reference {
  width: 32px;
  padding: 0;
  font-size: 18px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-divider {
  display: block;
  flex: 0 0 1px;
  width: 1px;
  height: 20px;
  margin-inline: 1px;
  background: #eadbc9;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  grid-template-columns: 38px minmax(0, 1fr) 42px;
  gap: 7px;
  width: 100%;
  min-height: 56px;
  padding: 6px;
  border-radius: 21px;
  transform: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer input {
  min-height: 42px;
  padding-inline: 10px;
  font-size: 13px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .voice-button,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .send-button {
  width: 38px;
  min-height: 38px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .send-button {
  width: 42px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-content {
  padding-bottom: calc(148px + env(safe-area-inset-bottom));
}

@media (max-width: 360px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase {
    min-height: 124px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
    right: 9px;
    width: min(calc(100% - 18px), 406px);
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button {
    min-height: 30px;
    padding-inline: 8px;
    font-size: 9.5px;
  }
}

/* v93 mobile capability bar */
#assistantScreen .assistant-showcase {
  min-height: 216px;
  padding-bottom: 72px;
}

#assistantScreen .assistant-feature-toolbar {
  right: 12px;
  bottom: 10px;
  left: 12px;
  overflow: hidden;
  padding: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(230, 211, 193, 0.92);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(87, 52, 28, 0.11);
  backdrop-filter: blur(12px);
}

#assistantScreen .assistant-feature-scroll {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}

#assistantScreen .assistant-feature-scroll::-webkit-scrollbar {
  display: none;
}

#assistantScreen .assistant-feature-scroll button {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 86px;
  min-height: 48px;
  place-items: initial;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  color: #563e2d;
  background: #fffaf5;
  border: 1px solid #ead8c8;
  border-radius: 8px;
  box-shadow: none;
  scroll-snap-align: start;
}

#assistantScreen .assistant-feature-scroll button.is-active {
  color: #ffffff;
  background: #9f5b28;
  border-color: #9f5b28;
  box-shadow: 0 4px 10px rgba(111, 62, 27, 0.2);
}

#assistantScreen .assistant-feature-scroll button img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
  border-radius: 5px;
}

#assistantScreen .assistant-feature-scroll button span {
  max-width: none;
  overflow: visible;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: nowrap;
}

#assistantScreen .assistant-feature-scroll .assistant-add-reference {
  min-width: 44px;
  width: 44px;
  padding: 0;
  color: #7a4b27;
  background: #ffffff;
}

#assistantScreen .assistant-feature-scroll .assistant-add-reference span {
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

#assistantScreen .assistant-feature-scroll .assistant-add-reference.has-reference {
  color: #ffffff;
  background: #257454;
  border-color: #257454;
}

#assistantScreen .assistant-feature-divider {
  flex: 0 0 1px;
  width: 1px;
  height: 30px;
  margin-inline: 2px;
  background: #e5d5c7;
}

#assistantScreen .assistant-mode-popover {
  bottom: 76px;
}

@media (max-width: 360px) {
  #assistantScreen .assistant-showcase {
    min-height: 208px;
  }

  #assistantScreen .assistant-feature-toolbar {
    right: 9px;
    left: 9px;
  }

  #assistantScreen .assistant-feature-scroll button {
    min-width: 82px;
    min-height: 46px;
    padding-inline: 8px;
  }

  #assistantScreen .assistant-feature-scroll .assistant-add-reference {
    min-width: 44px;
    width: 44px;
  }
}

/* v95 assistant capability priority */
#assistantScreen .assistant-showcase {
  min-height: 204px;
  padding-bottom: 68px;
}

#assistantScreen .assistant-feature-toolbar {
  padding: 5px;
  border-radius: 17px;
}

#assistantScreen .assistant-feature-scroll button {
  min-width: 80px;
  min-height: 46px;
  padding: 5px 8px;
  border-radius: 13px;
}

#assistantScreen .assistant-feature-scroll button.is-active {
  background: #ff9218;
  border-color: #ff9218;
  box-shadow: 0 5px 12px rgba(220, 111, 13, 0.22);
}

#assistantScreen .assistant-feature-scroll button span {
  font-size: 12px;
}

#assistantScreen .assistant-feature-scroll .assistant-add-reference {
  order: 0;
  min-width: 34px;
  width: 34px;
  max-width: 34px;
}

#assistantScreen .assistant-feature-divider {
  order: 0;
}

#assistantScreen [data-assistant-shortcut="quick"] {
  order: 1;
  min-width: 60px;
  width: 60px;
  max-width: 60px;
  padding-inline: 2px;
}

#assistantScreen [data-assistant-shortcut="writing"] {
  order: 2;
  min-width: 60px;
  width: 60px;
  max-width: 60px;
  padding-inline: 2px;
}

#assistantScreen [data-assistant-shortcut="image"] {
  order: 3;
  min-width: 60px;
  width: 60px;
  max-width: 60px;
  padding-inline: 2px;
}

#assistantScreen [data-assistant-shortcut="more"] {
  order: 4;
  min-width: 60px;
  width: 60px;
  max-width: 60px;
  padding-inline: 2px;
}

#assistantScreen [data-assistant-shortcut="quick"] span,
#assistantScreen [data-assistant-shortcut="writing"] span,
#assistantScreen [data-assistant-shortcut="image"] span,
#assistantScreen [data-assistant-shortcut="more"] span {
  font-size: 8.5px;
}

#assistantScreen [data-assistant-shortcut="music"] {
  order: 5;
}

#assistantScreen [data-assistant-shortcut="video"] {
  order: 6;
}

#assistantScreen [data-assistant-shortcut="ppt"] {
  order: 7;
}

@media (max-width: 360px) {
  #assistantScreen .assistant-showcase {
    min-height: 196px;
  }

  #assistantScreen [data-assistant-shortcut="quick"],
  #assistantScreen [data-assistant-shortcut="writing"],
  #assistantScreen [data-assistant-shortcut="image"],
  #assistantScreen [data-assistant-shortcut="more"] {
    min-width: 58px;
  }
}

/* v98 requested mobile capability order */
#assistantScreen .assistant-feature-toolbar {
  border-radius: 8px;
}

#assistantScreen .assistant-feature-scroll .assistant-add-reference {
  order: 0;
  flex: 0 0 44px;
  min-width: 44px;
  width: 44px;
  max-width: 44px;
}

#assistantScreen .assistant-feature-divider {
  order: 1;
}

#assistantScreen [data-assistant-shortcut="quick"] {
  order: 2;
}

#assistantScreen [data-assistant-shortcut="music"] {
  order: 3;
}

#assistantScreen [data-assistant-shortcut="image"] {
  order: 4;
}

#assistantScreen [data-assistant-shortcut="video"] {
  order: 5;
}

#assistantScreen [data-assistant-shortcut="ppt"] {
  order: 6;
}

#assistantScreen [data-assistant-shortcut="writing"] {
  order: 7;
}

#assistantScreen [data-assistant-shortcut="more"] {
  order: 8;
}

#assistantScreen .assistant-feature-scroll [data-assistant-shortcut] {
  flex: 0 0 auto;
  min-width: 82px;
  width: auto;
  max-width: none;
  min-height: 48px;
  padding-inline: 9px;
  border-radius: 8px;
}

#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"] span,
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="music"] span,
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="image"] span,
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="video"] span,
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="ppt"] span,
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="writing"] span,
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="more"] span {
  font-size: 10px;
  white-space: nowrap;
}

/* v101 assistant reference fidelity */
#assistantScreen .assistant-hero,
.phone-app.has-assistant-reply #assistantScreen .assistant-hero {
  padding-bottom: 12px;
  background: #fff1bd;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 12px 30px rgba(184, 119, 30, 0.08);
}

#assistantScreen .assistant-brand-row {
  padding-inline: 3px;
}

#assistantScreen .assistant-showcase {
  min-height: 160px;
  padding-bottom: 56px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 24px;
  box-shadow: 0 14px 28px rgba(179, 110, 20, 0.12);
}

#assistantScreen .assistant-content,
.phone-app.has-assistant-reply #assistantScreen .assistant-content {
  gap: 10px;
  padding-top: 16px;
}

.phone-app:not(.has-assistant-reply) #assistantScreen .assistant-block[aria-labelledby="styleTitle"],
.phone-app:not(.has-assistant-reply) #assistantScreen .quick-block {
  display: none;
}

#assistantScreen .assistant-starter-prompt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: end;
  justify-self: end;
  gap: 8px;
  width: min(92%, 354px);
  min-height: 44px;
  padding: 0;
  color: #4a3324;
  background: transparent;
  border: 0;
  text-align: left;
}

#assistantScreen .assistant-starter-copy {
  display: grid;
  gap: 3px;
  padding: 11px 15px;
  background: #ffedb7;
  border: 1px solid rgba(239, 188, 77, 0.42);
  border-radius: 21px 21px 6px 21px;
  box-shadow: 0 10px 22px rgba(176, 111, 20, 0.09);
}

#assistantScreen .assistant-starter-copy small {
  color: #b87b28;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
}

#assistantScreen .assistant-starter-copy strong {
  font-size: 13px;
  font-weight: 850;
  line-height: 1.42;
}

#assistantScreen .assistant-starter-prompt > img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #efc669;
}

#assistantScreen .assistant-welcome-card {
  grid-template-columns: 46px minmax(0, 1fr);
  justify-self: start;
  gap: 9px;
  width: min(94%, 362px);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#assistantScreen .assistant-welcome-card > div {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #eee1d4;
  border-radius: 7px 21px 21px 21px;
  box-shadow: 0 10px 22px rgba(80, 55, 31, 0.08);
}

#assistantScreen .assistant-welcome-card > img {
  width: 46px;
  height: 46px;
}

#assistantScreen .assistant-welcome-card strong {
  font-size: 13px;
}

#assistantScreen .assistant-welcome-card p {
  margin-top: 4px;
  font-size: 10.5px;
}

#assistantScreen .assistant-welcome-card span {
  margin-top: 6px;
  font-size: 9px;
}

.phone-app.has-assistant-reply #assistantScreen .assistant-starter-prompt {
  display: none;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .assistant-chat-log {
  order: 0;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .sent-message-card {
  order: 10;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card,
#assistantScreen .assistant-chat-turn .reply-card {
  display: contents;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card > .reply-head,
#assistantScreen .assistant-chat-turn .reply-head {
  order: 20;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .generation-panel,
#assistantScreen .assistant-chat-turn > .generation-panel {
  order: 30;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card > .prompt-card,
#assistantScreen .assistant-chat-turn .prompt-card {
  order: 40;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .action-grid {
  order: 50;
}

#assistantScreen .assistant-chat-turn {
  display: grid;
  gap: 10px;
}

#assistantScreen .prompt-card {
  margin-left: 0;
  padding: 14px 15px;
  background: #fff7e6;
  border-color: #f1d59d;
  border-radius: 20px;
}

#assistantScreen .prompt-card-head {
  display: contents;
}

#assistantScreen .prompt-card-head h2 {
  display: flex;
  grid-row: 1;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 14px;
}

#assistantScreen .prompt-card-head h2 img {
  width: 21px;
  height: 21px;
}

#assistantScreen .prompt-card #assistantPrompt,
#assistantScreen .assistant-chat-turn .prompt-card p {
  grid-row: 2;
  font-size: 11px;
  line-height: 1.6;
}

#assistantScreen .prompt-card-head button {
  grid-row: 3;
  justify-self: end;
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 14px;
  box-shadow: 0 7px 14px rgba(217, 127, 12, 0.18);
}

#assistantScreen .generation-panel[data-result-mode="media"] {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#assistantScreen .generation-panel[data-result-mode="media"] .generation-head,
#assistantScreen .generation-panel .generation-actions {
  display: none;
}

#assistantScreen .assistant-result-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

#assistantScreen .generation-panel[data-result-mode="media"] .generation-body {
  position: relative;
}

#assistantScreen .assistant-result-gallery img {
  width: 100%;
  height: clamp(92px, 25vw, 100px);
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 9px 18px rgba(71, 49, 27, 0.13);
}

#assistantScreen .assistant-result-gallery img:nth-child(1) {
  object-position: 12.5% 50%;
}

#assistantScreen .assistant-result-gallery img:nth-child(2) {
  object-position: 37.5% 50%;
}

#assistantScreen .assistant-result-gallery img:nth-child(3) {
  object-position: 62.5% 50%;
}

#assistantScreen .assistant-result-gallery img:nth-child(4) {
  object-position: 87.5% 50%;
}

#assistantScreen .agent-status[data-state="done"] {
  display: none;
}

#assistantScreen .assistant-result-note {
  position: absolute;
  right: 6px;
  bottom: 6px;
  margin: 0;
  padding: 5px 8px;
  color: #77573e;
  background: rgba(255, 250, 241, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 5px 12px rgba(86, 54, 28, 0.1);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

#assistantScreen .action-grid button {
  min-height: 52px;
  border-radius: 16px;
}

@media (max-width: 360px) {
  #assistantScreen .assistant-showcase {
    min-height: 158px;
    padding-bottom: 55px;
  }

  #assistantScreen .assistant-starter-prompt {
    width: 96%;
  }

  #assistantScreen .assistant-welcome-card {
    width: 98%;
  }

  #assistantScreen .assistant-result-gallery {
    gap: 5px;
  }

  #assistantScreen .assistant-result-gallery img {
    border-radius: 12px;
  }
}

/* v108 unified assistant composer */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
  gap: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-height: 88px;
  padding: 8px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(219, 194, 163, 0.86);
  border-radius: 23px;
  box-shadow: 0 -10px 28px rgba(87, 61, 35, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer > input {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  color: #3e342d;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 13px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer > input:focus {
  outline: none;
  box-shadow: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-toolbar {
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  gap: 5px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button {
  min-height: 30px;
  padding-inline: 8px;
  border-radius: 10px;
  font-size: 9.5px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button img {
  width: 13px;
  height: 13px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll .assistant-add-reference {
  width: 30px;
  min-width: 30px;
  font-size: 16px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row .send-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  align-self: center;
  border-radius: 50%;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-popover {
  position: absolute;
  right: auto;
  bottom: calc(100% + 8px);
  left: 36px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 176px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(225, 202, 173, 0.92);
  border-radius: 15px;
  box-shadow: 0 12px 30px rgba(86, 57, 29, 0.18);
  transform: none;
  backdrop-filter: blur(18px);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-popover[hidden] {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-popover button {
  min-height: 34px;
  padding: 0 8px;
  color: #6b513d;
  background: #fffaf4;
  border: 1px solid #eadbc9;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 850;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-popover button.is-active {
  color: #fff;
  background: #ff8a18;
  border-color: #ff8a18;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-content {
  padding-bottom: calc(122px + env(safe-area-inset-bottom));
}

@media (max-width: 360px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
    min-height: 84px;
    padding: 7px;
    border-radius: 21px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button {
    min-height: 29px;
    padding-inline: 7px;
    font-size: 9px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-popover {
    left: 32px;
    width: 166px;
  }
}

/* v109 plus attachment menu */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-menu {
  position: absolute;
  right: auto;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 61;
  display: grid;
  gap: 4px;
  width: 156px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(225, 202, 173, 0.92);
  border-radius: 15px;
  box-shadow: 0 12px 30px rgba(86, 57, 29, 0.18);
  backdrop-filter: blur(18px);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-menu[hidden] {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-menu button {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  color: #4f3b2e;
  background: transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-menu button:active {
  background: #fff2df;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-menu img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-add-reference.has-reference {
  color: #fff;
  background: #ff8a18;
  border-color: #ff8a18;
}

/* v111 neutral centered mode control */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"].is-active {
  min-width: 58px;
  justify-content: center;
  color: #59483b;
  background: #fffaf4;
  border-color: #e5d4c0;
  box-shadow: none;
  text-align: center;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"].is-menu-open {
  color: #4e3a2c;
  background: #fff4e6;
  border-color: #dfc6aa;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-label {
  display: block;
  width: 100%;
  text-align: center;
}

/* v113 profile cascade guard */
#profileScreen.profile-screen {
  padding-bottom: 0;
  background: #fffaf4;
}

/* v116 curated creative agents */
.home-agent-section {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding-bottom: 8px;
}

.home-agent-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #776c62;
  font-size: 12px;
  font-weight: 600;
}

.home-agent-heading > span i,
.home-agent-live i {
  width: 6px;
  height: 6px;
  background: #46b978;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(70, 185, 120, 0.12);
}

.home-agent-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  align-items: center;
  min-height: 92px;
  overflow: hidden;
  padding: 15px 12px 14px 17px;
  background: #fff3ce;
  border: 1px solid #f3d98f;
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(111, 76, 28, 0.08);
}

.home-agent-intro strong {
  display: block;
  color: #3a2113;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.home-agent-intro p {
  max-width: 230px;
  margin: 6px 0 0;
  color: #796856;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.home-agent-intro > img {
  position: absolute;
  right: 5px;
  bottom: -14px;
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.home-agent-filters {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  padding: 1px 1px 3px;
  scrollbar-width: none;
}

.home-agent-filters::-webkit-scrollbar {
  display: none;
}

.home-agent-filters button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 13px;
  color: #74685e;
  background: #fff;
  border: 1px solid #eadccc;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.home-agent-filters button.is-active {
  color: #fff;
  background: #3c2418;
  border-color: #3c2418;
  box-shadow: 0 6px 14px rgba(60, 36, 24, 0.14);
}

.home-agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.home-agent-card {
  --agent-accent: #e9a424;
  --agent-tint: #fff7e4;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 9px;
  min-width: 0;
  min-height: 174px;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 20px;
  box-shadow: 0 9px 22px rgba(86, 59, 35, 0.075);
}

.home-agent-card.tone-blue { --agent-accent: #448ded; --agent-tint: #edf5ff; }
.home-agent-card.tone-rose { --agent-accent: #ee7181; --agent-tint: #fff0f2; }
.home-agent-card.tone-orange { --agent-accent: #ef8a37; --agent-tint: #fff2e8; }
.home-agent-card.tone-mint { --agent-accent: #54a671; --agent-tint: #eef8f1; }
.home-agent-card.tone-purple { --agent-accent: #b86b2b; --agent-tint: #fff0db; }
.home-agent-card.tone-green { --agent-accent: #63a753; --agent-tint: #eff8ec; }
.home-agent-card.tone-sand { --agent-accent: #b7844b; --agent-tint: #f8f1e9; }

.home-agent-card:active {
  transform: translateY(1px);
}

.home-agent-card-top,
.home-agent-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.home-agent-card-art {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: var(--agent-tint);
  border: 1px solid color-mix(in srgb, var(--agent-accent) 24%, #fff);
  border-radius: 15px;
}

.home-agent-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-agent-card[data-creative-agent="brand-writer"] .home-agent-card-art img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.home-agent-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6f776f;
  font-size: 12px;
  font-weight: 500;
}

.home-agent-card-copy {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.home-agent-card-copy small {
  color: var(--agent-accent);
  font-size: 12px;
  font-weight: 600;
}

.home-agent-card-copy strong {
  color: #35251d;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.18;
}

.home-agent-card-copy > span {
  display: -webkit-box;
  min-height: 34px;
  overflow: hidden;
  color: #84776d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-agent-card-footer {
  padding-top: 8px;
  border-top: 1px solid #f0e8df;
}

.home-agent-card-footer em {
  min-width: 0;
  overflow: hidden;
  color: #75695f;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-agent-card-footer img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.72;
}

.creative-agent-dialog {
  width: min(calc(100% - 20px), 410px);
  max-width: 410px;
  margin: auto auto 8px;
  padding: 0;
  overflow: visible;
  color: #35251d;
  background: transparent;
  border: 0;
}

.creative-agent-dialog::backdrop {
  background: rgba(44, 31, 22, 0.42);
  backdrop-filter: blur(5px);
}

.creative-agent-dialog > article {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  background: #fffaf4;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(61, 40, 24, 0.24);
}

.creative-agent-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-height: 30px;
  padding: 0 10px;
  color: #7b6f65;
  background: #f7eee5;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.creative-agent-dialog header {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding-right: 54px;
}

.creative-agent-dialog-art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  overflow: hidden;
  background: #fff1cf;
  border: 1px solid #edd8aa;
  border-radius: 20px;
}

.creative-agent-dialog-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creative-agent-dialog header small {
  color: #d2831e;
  font-size: 10px;
  font-weight: 900;
}

.creative-agent-dialog header h2 {
  margin: 3px 0 0;
  color: #352116;
  font-size: 22px;
  font-weight: 950;
}

.creative-agent-dialog header p {
  margin: 4px 0 0;
  color: #7a6d63;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.45;
}

.creative-agent-dialog-body {
  display: grid;
  gap: 14px;
}

.creative-agent-capabilities,
.creative-agent-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.creative-agent-capabilities span {
  padding: 6px 10px;
  color: #815a2e;
  background: #fff1d6;
  border: 1px solid #efd6ab;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.creative-agent-dialog-body h3 {
  margin: 0 0 8px;
  color: #49362b;
  font-size: 12px;
  font-weight: 950;
}

.creative-agent-examples button {
  flex: 1 1 calc(50% - 4px);
  min-height: 44px;
  padding: 9px 10px;
  color: #6f6258;
  text-align: left;
  background: #fff;
  border: 1px solid #eadfd5;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.4;
}

.creative-agent-examples button.is-active {
  color: #6d3f10;
  background: #fff2d8;
  border-color: #efc77e;
}

.creative-agent-start {
  min-height: 48px;
  color: #fff;
  background: #f28a18;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(211, 117, 18, 0.22);
  font-size: 14px;
  font-weight: 950;
}

@media (max-width: 360px) {
  .home-agent-grid {
    gap: 8px;
  }

  .home-agent-card {
    min-height: 168px;
    padding: 10px;
  }

  .home-agent-card-copy strong {
    font-size: 14px;
  }

  .home-agent-card-copy > span {
    font-size: 9px;
  }
}

#profileScreen .profile-stat-grid button {
  min-height: 0;
}

#profileScreen .profile-settings-panel label:nth-of-type(n + 3) {
  margin-top: 0;
}

@media (max-width: 360px) {
  #profileScreen .profile-settings-panel label {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* v114 home safe gutter */
:root {
  --home-page-gutter: clamp(16px, 4.6vw, 20px);
}

html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.app-screen-home .home-hero,
.app-screen-home .home-content {
  width: 100%;
  padding-left: max(var(--home-page-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--home-page-gutter), env(safe-area-inset-right, 0px));
}

.app-screen-home .home-brand-row {
  padding-inline: 2px;
}

.app-screen-home .inspiration-card,
.app-screen-home .home-recent-section,
.app-screen-home .case-strip,
.app-screen-home .home-recent-grid {
  width: 100%;
  min-width: 0;
}

.app-screen-home .case-strip {
  gap: 10px;
}

.app-screen-home .section-head {
  padding-inline: 2px;
}

@media (max-width: 360px) {
  .app-screen-home .home-hero,
  .app-screen-home .home-content {
    padding-left: max(var(--home-page-gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--home-page-gutter), env(safe-area-inset-right, 0px));
  }
}

/* v115 stable inner gutters for home and template center */
:root {
  --mobile-content-gutter: clamp(17px, 5.2vw, 24px);
}

.app-screen-home .home-hero,
.app-screen-home .home-content,
.templates-screen .template-page-content {
  width: 100%;
  padding-left: max(var(--mobile-content-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--mobile-content-gutter), env(safe-area-inset-right, 0px));
}

.templates-screen .template-page-content {
  gap: 16px;
  padding-bottom: calc(var(--nav-height) + 36px + env(safe-area-inset-bottom));
}

.templates-screen .template-center-hero,
.templates-screen .template-center-panel,
.templates-screen .template-search,
.templates-screen .template-page-tabs,
.templates-screen .template-filter-row,
.templates-screen .template-result-summary,
.templates-screen .template-page-grid {
  width: 100%;
  min-width: 0;
}

.templates-screen .template-page-tabs {
  margin-inline: 0;
  padding-inline: 0;
  scroll-padding-inline: 0;
}

.templates-screen .template-media-filters,
.templates-screen .template-library-card {
  min-width: 0;
}

.app-screen-home .inspiration-card,
.app-screen-home .home-recent-section {
  width: 100%;
  min-width: 0;
}

@media (max-width: 340px) {
  .templates-screen .template-page-grid {
    grid-template-columns: 1fr;
  }
}

/* v115 reference-faithful profile */
:root {
  --profile-gutter: clamp(16px, 4.4vw, 19px);
  --profile-brown: #3b1d0f;
  --profile-muted: #8d8278;
  --profile-line: #eee2d5;
  --profile-orange: #ffa51e;
}

#profileScreen.profile-screen {
  min-height: 100dvh;
  padding-bottom: 0;
  color: #332720;
  background:
    radial-gradient(circle at 50% 7%, rgba(255, 231, 164, 0.28), transparent 26%),
    #fffaf4;
}

#profileScreen [hidden] {
  display: none !important;
}

#profileScreen .profile-topbar {
  display: flex;
  min-height: calc(70px + env(safe-area-inset-top));
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--profile-gutter) 5px;
}

#profileScreen .home-brand-lockup {
  min-width: 0;
}

#profileScreen .home-brand-title {
  gap: 7px;
}

#profileScreen .home-brand-title strong {
  color: var(--profile-brown);
  font-size: clamp(25px, 7.1vw, 29px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -1.2px;
}

#profileScreen .home-brand-title img {
  width: 26px;
  height: 26px;
}

#profileScreen .home-brand-lockup p {
  margin: 5px 0 0;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

#profileScreen .home-header-actions {
  flex: 0 0 auto;
  gap: 10px;
}

#profileScreen .home-alert-button,
#profileScreen .home-avatar-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(238, 219, 198, 0.94);
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(105, 72, 38, 0.08);
}

#profileScreen .home-alert-button img {
  width: 20px;
  height: 20px;
}

#profileScreen .home-avatar-button {
  overflow: hidden;
  border: 3px solid #fff;
}

#profileScreen .home-avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#profileScreen .profile-alert-button {
  position: relative;
  overflow: visible;
}

#profileScreen .profile-unread-dot {
  position: absolute;
  top: 2px;
  right: 1px;
  width: 8px;
  height: 8px;
  background: #ff574f;
  border: 2px solid #fffaf4;
  border-radius: 50%;
}

#profileScreen .profile-page-content {
  display: grid;
  width: 100%;
  gap: 14px;
  padding: 8px var(--profile-gutter) calc(var(--nav-height) + 30px + env(safe-area-inset-bottom));
}

#profileScreen .profile-identity-card {
  position: relative;
  min-width: 0;
  min-height: clamp(226px, 60vw, 246px);
  overflow: hidden;
  background: #ffd867;
  border: 1px solid rgba(248, 202, 92, 0.9);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(161, 103, 34, 0.12);
}

#profileScreen .profile-identity-card.is-empty-stats {
  min-height: 200px;
}

#profileScreen .profile-identity-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

#profileScreen .profile-identity-card::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 224, 137, 0.14) 0%, transparent 58%);
}

#profileScreen .profile-identity-copy {
  position: absolute;
  top: 51px;
  left: 20px;
  z-index: 2;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  width: 61%;
  align-items: center;
  column-gap: 11px;
  padding: 0;
}

#profileScreen .profile-identity-avatar {
  display: block;
  grid-column: 1;
  grid-row: 1 / 3;
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: #fff4df;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(82, 48, 22, 0.15);
}

#profileScreen .profile-name-row {
  display: flex;
  grid-column: 2;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#profileScreen .profile-name-row h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--profile-brown);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.16;
  letter-spacing: -0.6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profileScreen .profile-vip-badge {
  flex: 0 0 auto;
  padding: 4px 6px;
  color: #fff;
  background: #ffa414;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(227, 130, 13, 0.2);
  font-size: 8.5px;
  font-weight: 950;
  line-height: 1;
}

#profileScreen .profile-identity-copy > p {
  grid-column: 2;
  max-width: 140px;
  margin: 5px 0 0;
  color: #68431f;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.38;
}

#profileScreen .profile-empty-summary {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  min-height: 48px;
  margin: 0;
  padding: 10px 13px;
  color: #6e4b28;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(94, 65, 35, 0.08);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

#profileScreen .profile-empty-summary[hidden],
#profileScreen .profile-stat-grid[hidden] {
  display: none;
}

#profileScreen .profile-stat-grid {
  position: absolute;
  right: 11px;
  bottom: 10px;
  left: 11px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 84px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 17px;
  box-shadow: 0 7px 18px rgba(94, 65, 35, 0.08);
  backdrop-filter: blur(12px);
}

#profileScreen .profile-stat-grid button {
  display: grid;
  min-width: 0;
  min-height: 84px;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 6px 3px;
  color: #2f2824;
  background: transparent;
  border-radius: 0;
}

#profileScreen .profile-stat-grid button + button {
  border-left: 1px solid #f1e9df;
}

#profileScreen .profile-stat-grid img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  opacity: 1;
}

#profileScreen .profile-stat-grid strong {
  margin-top: 2px;
  color: #2d2622;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

#profileScreen .profile-stat-grid span {
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

#profileScreen .profile-membership-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-height: 72px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(90deg, #fff7df, #fff1c6);
  border: 1px solid #f1dca6;
  border-radius: 15px;
  box-shadow: 0 7px 20px rgba(130, 88, 38, 0.07);
}

#profileScreen .profile-membership-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  background: #ffc34f;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(222, 145, 28, 0.15);
}

#profileScreen .profile-membership-icon img {
  width: 25px;
  height: 25px;
}

#profileScreen .profile-membership-card.is-account-entry {
  background: linear-gradient(100deg, #fffaf1, #fff2d4);
}

#profileScreen .profile-membership-card.is-account-entry .profile-membership-icon {
  background: #fff6e5;
}

#profileScreen .profile-membership-card.is-account-entry .profile-membership-icon img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

#profileScreen .profile-membership-card > div {
  min-width: 0;
}

#profileScreen .profile-membership-card strong {
  display: block;
  overflow: hidden;
  color: #4a2a18;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profileScreen .profile-membership-card p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profileScreen .profile-membership-card > button {
  min-width: 88px;
  min-height: 42px;
  padding: 0 14px;
  color: #3a250f;
  background: #ffab1d;
  border: 1px solid #ffa316;
  border-radius: 999px;
  box-shadow: 0 6px 13px rgba(226, 132, 16, 0.16);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

#profileScreen .profile-menu-card {
  overflow: hidden;
  padding: 2px 17px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(238, 227, 215, 0.94);
  border-radius: 15px;
  box-shadow: 0 9px 24px rgba(82, 57, 33, 0.07);
}

#profileScreen .profile-menu-card > button {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 17px;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  color: #332d29;
  background: transparent;
  border-radius: 0;
  text-align: left;
}

#profileScreen .profile-menu-card > button + button {
  border-top: 1px solid #f2e9df;
}

#profileScreen .profile-menu-card > .profile-works-entry {
  grid-template-columns: 32px minmax(0, 1fr) auto 15px;
  min-height: 62px;
}

#profileScreen .profile-works-entry .profile-menu-icon {
  background: #fff1cf;
  border: 1px solid #ffe0a1;
  border-radius: 10px;
}

#profileScreen .profile-menu-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

#profileScreen .profile-menu-copy small {
  overflow: hidden;
  color: #8a7463;
  font-size: 10.5px;
  font-weight: 560;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profileScreen .profile-menu-count {
  display: grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  padding: 0 7px;
  color: #9a5817;
  background: #fff2d8;
  border: 1px solid #f5d49c;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

#profileScreen .profile-menu-card strong {
  font-size: 14px;
  font-weight: 760;
}

#profileScreen .profile-menu-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: transparent;
  border-radius: 0;
}

#profileScreen .profile-menu-icon img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

#profileScreen .profile-menu-arrow {
  width: 15px;
  height: 15px;
  object-fit: contain;
  opacity: 0.48;
}

#profileScreen .profile-menu-unread {
  position: absolute;
  right: 27px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  background: #ff665c;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

#profileScreen .profile-subpanel {
  min-width: 0;
  scroll-margin-top: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--profile-line);
  border-radius: 16px;
  box-shadow: 0 9px 24px rgba(82, 57, 33, 0.07);
}

#profileScreen .profile-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#profileScreen .profile-panel-head > div {
  display: grid;
  gap: 2px;
}

#profileScreen .profile-panel-head span {
  color: #c47828;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
}

#profileScreen .profile-panel-head strong {
  color: #3c2a20;
  font-size: 16px;
  font-weight: 950;
}

#profileScreen .profile-panel-head > button,
#profileScreen .profile-panel-secondary {
  min-height: 34px;
  padding: 0 12px;
  color: #826e5c;
  background: #fff8ef;
  border: 1px solid #eadbcb;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

#profileScreen .profile-notice-list,
#profileScreen .profile-history-list {
  display: grid;
  gap: 8px;
}

#profileScreen .profile-notice-list > button {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px;
  color: #3f332b;
  background: #fffaf4;
  border: 1px solid #eee2d5;
  border-radius: 12px;
  text-align: left;
}

#profileScreen .profile-notice-mark {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  background: #78c867;
  border-radius: 50%;
}

#profileScreen [data-notice-tone="pending"] .profile-notice-mark {
  background: #ffb42f;
}

#profileScreen [data-notice-tone="fallback"] .profile-notice-mark {
  background: #f06b63;
}

#profileScreen .profile-notice-list > button > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

#profileScreen .profile-notice-list strong {
  font-size: 12px;
  font-weight: 600;
}

#profileScreen .profile-notice-list small {
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

#profileScreen .profile-notice-list time {
  color: var(--color-text-subtle, #7a6d64);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

#profileScreen .profile-history-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #fffaf4;
  border: 1px solid #eee2d5;
  border-radius: 12px;
}

#profileScreen .profile-history-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#profileScreen .profile-history-item header strong {
  min-width: 0;
  overflow: hidden;
  color: #3b2c23;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profileScreen .profile-history-item time {
  flex: 0 0 auto;
  color: var(--color-text-subtle, #7a6d64);
  font-size: 12px;
  font-weight: 500;
}

#profileScreen .profile-history-item p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--color-text-muted, #6f6259);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#profileScreen .profile-history-item button {
  justify-self: end;
  min-height: 31px;
  padding: 0 11px;
  color: #a65f1e;
  background: #fff1dc;
  border: 1px solid #f0d1a8;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 850;
}

#profileScreen .profile-panel-secondary {
  width: 100%;
  margin-top: 10px;
}

#profileScreen .profile-panel-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 96px;
  padding: 18px;
  color: #8b7c70;
  background: #fffaf4;
  border: 1px dashed #e8d6c5;
  border-radius: 12px;
  text-align: center;
}

#profileScreen .profile-panel-empty strong {
  color: #5a4638;
  font-size: 12px;
  font-weight: 900;
}

#profileScreen .profile-panel-empty span {
  max-width: 250px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
}

#profileScreen .profile-member-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px;
  background: #fff7dd;
  border: 1px solid #f0d99e;
  border-radius: 13px;
}

#profileScreen .profile-member-summary strong {
  color: #4d2e1d;
  font-size: 14px;
  font-weight: 950;
}

#profileScreen .profile-member-summary p {
  grid-column: 1;
  margin: 0;
  color: #967652;
  font-size: 9.5px;
  line-height: 1.4;
}

#profileScreen .profile-member-summary button {
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: 34px;
  padding: 0 11px;
  color: #8d6543;
  background: #fff;
  border: 1px solid #ead7c1;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 850;
}

#profileScreen .profile-auth-form {
  display: grid;
  gap: 9px;
}

#profileScreen .profile-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: #f7efe5;
  border-radius: 12px;
}

#profileScreen .profile-auth-tabs button {
  min-height: 36px;
  color: #8b7561;
  background: transparent;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 850;
}

#profileScreen .profile-auth-tabs button.is-active {
  color: #673b1a;
  background: #fff;
  box-shadow: 0 3px 10px rgba(92, 61, 30, 0.08);
}

#profileScreen .profile-auth-form label,
#profileScreen .profile-settings-panel > label {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 48px;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 10px;
  background: #fffaf4;
  border: 1px solid #eee2d5;
  border-radius: 11px;
}

#profileScreen .profile-auth-form label > span,
#profileScreen .profile-settings-panel > label > span {
  color: #786b61;
  font-size: 10.5px;
  font-weight: 800;
}

#profileScreen .profile-auth-form input,
#profileScreen .profile-settings-panel input,
#profileScreen .profile-settings-panel select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  color: #3b312b;
  background: #fff;
  border: 1px solid #e3d6c7;
  border-radius: 8px;
  outline: none;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
}

#profileScreen .profile-auth-form input:focus,
#profileScreen .profile-settings-panel input:focus,
#profileScreen .profile-settings-panel select:focus {
  border-color: #e8b66f;
  box-shadow: 0 0 0 3px rgba(232, 182, 111, 0.14);
}

#profileScreen .profile-auth-status,
#profileScreen .profile-settings-status {
  margin: 1px 2px;
  color: #8c7c70;
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.45;
}

#profileScreen .profile-auth-submit {
  min-height: 42px;
  color: #3a250f;
  background: #ffa71b;
  border: 1px solid #ff9e12;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 13px rgba(226, 132, 16, 0.14);
}

#profileScreen .profile-avatar-setting {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: #fffaf4;
  border: 1px solid #eee2d5;
  border-radius: 11px;
}

#profileScreen .profile-avatar-setting img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(94, 61, 30, 0.1);
}

#profileScreen .profile-avatar-setting > div {
  display: grid;
  gap: 2px;
}

#profileScreen .profile-avatar-setting strong {
  color: #4e3b2e;
  font-size: 11px;
  font-weight: 900;
}

#profileScreen .profile-avatar-setting span {
  color: #9a8b7f;
  font-size: 9px;
}

#profileScreen .profile-avatar-setting button {
  min-height: 34px;
  padding: 0 12px;
  color: #9b5f23;
  background: #fff0da;
  border: 1px solid #eccb9f;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 850;
}

#profileScreen .profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 3px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#profileScreen .profile-actions button {
  min-height: 40px;
  color: #735f50;
  background: #fff7ed;
  border: 1px solid #ead9c7;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 850;
}

#profileScreen .profile-actions #clearAllDataBtn {
  color: #b45145;
  background: #fff2ef;
  border-color: #f2d1ca;
}

.phone-app[data-active-screen="profile"] .bottom-nav [data-open-screen="profile"] {
  color: #ff8415;
}

.phone-app[data-active-screen="profile"] .bottom-nav [data-open-screen="profile"] img {
  filter: sepia(1) saturate(6) hue-rotate(345deg) brightness(1.08);
}

@media (max-width: 360px) {
  #profileScreen .profile-identity-copy {
    top: 49px;
    left: 17px;
    grid-template-columns: 58px minmax(0, 1fr);
    width: 66%;
    column-gap: 9px;
  }

  #profileScreen .profile-identity-avatar {
    width: 58px;
    height: 58px;
  }

  #profileScreen .profile-name-row h2 {
    font-size: 16px;
  }

  #profileScreen .profile-membership-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  #profileScreen .profile-membership-icon {
    width: 42px;
    height: 42px;
  }

  #profileScreen .profile-membership-card strong {
    font-size: 12.5px;
  }

  #profileScreen .profile-membership-card > button {
    min-width: 78px;
    padding-inline: 10px;
  }

  #profileScreen .profile-menu-card {
    padding-inline: 14px;
  }

  #profileScreen .profile-auth-form label,
  #profileScreen .profile-settings-panel > label {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* v117 home lower-section detail polish */
.app-screen-home .inspiration-card,
.app-screen-home .home-recent-section,
.app-screen-home .home-agent-section {
  gap: 12px;
}

.app-screen-home .inspiration-card,
.app-screen-home .home-recent-section {
  padding-block: 2px;
}

.app-screen-home .section-head {
  min-height: 30px;
  padding-inline: 1px;
}

.app-screen-home .section-head > div {
  gap: 8px;
}

.app-screen-home .section-head h2 {
  font-size: 18px;
  line-height: 1.12;
  letter-spacing: -0.35px;
}

.app-screen-home .section-head > button {
  min-width: 42px;
  min-height: 30px;
  color: #776c63;
  border-radius: 999px;
}

.app-screen-home .section-head > button:focus-visible,
.app-screen-home .case-strip button:focus-visible,
.app-screen-home .home-recent-create:focus-visible,
.app-screen-home .home-agent-filters button:focus-visible,
.app-screen-home .home-agent-card:focus-visible {
  outline: 2px solid #f29a24;
  outline-offset: 3px;
}

.app-screen-home .case-strip {
  gap: 9px;
}

.app-screen-home .case-strip button {
  height: 94px;
  background: #fff;
  border: 1px solid rgba(233, 220, 204, 0.82);
  border-radius: 17px;
  box-shadow: 0 8px 18px rgba(74, 48, 25, 0.09);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.app-screen-home .case-strip img {
  border-radius: 16px;
}

.app-screen-home .case-strip strong {
  right: 5px;
  bottom: 5px;
  left: 5px;
  padding: 6px 3px;
  background: rgba(53, 36, 24, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(37, 23, 14, 0.16);
  backdrop-filter: blur(5px);
}

.home-recent-grid {
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 9px;
  min-height: 80px;
}

.home-recent-empty {
  grid-column: auto;
  min-height: 80px;
  padding: 12px 15px;
  background: #fffdfb;
  border-color: #eadbc9;
  border-radius: 17px;
  box-shadow: 0 7px 16px rgba(72, 47, 25, 0.055);
}

.home-recent-empty strong {
  font-size: 13px;
  letter-spacing: -0.1px;
}

.home-recent-empty span {
  margin-top: 5px;
  color: #8d8177;
  font-size: 12px;
  line-height: 1.35;
}

.home-recent-create {
  min-height: 80px;
  gap: 6px;
  color: #836f5e;
  background: #fffaf3;
  border-color: #ead9c5;
  border-radius: 17px;
  box-shadow: 0 7px 16px rgba(72, 47, 25, 0.055);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.home-recent-create img {
  width: 21px;
  height: 21px;
  opacity: 0.82;
}

.home-recent-create span {
  font-size: 12px;
  font-weight: 600;
}

.app-screen-home .home-agent-section {
  padding: 4px 0 12px;
}

.app-screen-home .home-agent-heading > div > img {
  width: 19px;
  height: 19px;
}

.app-screen-home .home-agent-heading > span {
  gap: 6px;
  color: #756c64;
  font-size: 12px;
}

.app-screen-home .home-agent-heading > span i,
.app-screen-home .home-agent-live i {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 3px rgba(70, 185, 120, 0.11);
}

.app-screen-home .home-agent-intro {
  grid-template-columns: minmax(0, 1fr) 86px;
  min-height: 118px;
  padding: 14px 12px 14px 16px;
  background: #fff3cf;
  border-color: #efd48a;
  border-radius: 21px;
  box-shadow: 0 9px 22px rgba(111, 76, 28, 0.075);
}

.home-agent-intro-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  min-width: 0;
}

.home-agent-intro-copy > span {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 8px;
  color: #9c681d;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(226, 179, 83, 0.42);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
}

.app-screen-home .home-agent-intro strong {
  margin-top: 7px;
  font-size: 15.5px;
  line-height: 1.18;
  letter-spacing: -0.3px;
}

.app-screen-home .home-agent-intro p {
  max-width: 230px;
  margin-top: 5px;
  color: #756554;
  font-size: 12px;
  line-height: 1.45;
}

.home-agent-intro-visual {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(225, 174, 72, 0.48);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(120, 77, 20, 0.11);
}

.home-agent-intro-visual img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.app-screen-home .home-agent-filters {
  gap: 7px;
  padding: 0 1px 2px;
}

.app-screen-home .home-agent-filters button {
  min-height: 29px;
  padding-inline: 12px;
  color: #72665d;
  border-color: #e8d9c9;
  font-size: 12px;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.app-screen-home .home-agent-filters button.is-active {
  background: #43291b;
  border-color: #43291b;
  box-shadow: 0 5px 12px rgba(67, 41, 27, 0.14);
}

.app-screen-home .home-agent-grid {
  gap: 9px;
}

.app-screen-home .home-agent-card {
  position: relative;
  grid-template-rows: 70px 1fr auto;
  gap: 7px;
  min-height: 205px;
  padding: 11px;
  overflow: hidden;
  border-color: #eadfd5;
  border-radius: 18px;
  background: #fffdfb;
  box-shadow: 0 7px 18px rgba(69, 43, 23, 0.08);
  isolation: isolate;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.app-screen-home .home-agent-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 84px;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(35, 22, 14, 0.03) 0%, rgba(35, 22, 14, 0.12) 70%, #fffdfb 100%),
    linear-gradient(120deg, color-mix(in srgb, var(--agent-accent) 10%, transparent), transparent 58%);
  content: "";
  pointer-events: none;
}

.app-screen-home .home-agent-card-bg {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  width: 100%;
  height: 84px;
  object-fit: cover;
  filter: saturate(0.82) contrast(0.98);
  transform: scale(1.01);
  transition: transform 220ms ease, filter 220ms ease;
}

.app-screen-home .home-agent-card[data-creative-agent="creative-director"] .home-agent-card-bg { object-position: 67% center; }
.app-screen-home .home-agent-card[data-creative-agent="visual-director"] .home-agent-card-bg { object-position: 54% 35%; }
.app-screen-home .home-agent-card[data-creative-agent="video-director"] .home-agent-card-bg { object-position: center 35%; }
.app-screen-home .home-agent-card[data-creative-agent="brand-writer"] .home-agent-card-bg { object-position: center 28%; }
.app-screen-home .home-agent-card[data-creative-agent="poster-designer"] .home-agent-card-bg { object-position: 58% 45%; }
.app-screen-home .home-agent-card[data-creative-agent="pet-ip-designer"] .home-agent-card-bg { object-position: center 38%; }
.app-screen-home .home-agent-card[data-creative-agent="deck-strategist"] .home-agent-card-bg { object-position: center 43%; }
.app-screen-home .home-agent-card[data-creative-agent="commerce-visual"] .home-agent-card-bg { object-position: center 48%; }

.app-screen-home .home-agent-card-top,
.app-screen-home .home-agent-card-copy,
.app-screen-home .home-agent-card-footer {
  position: relative;
  z-index: 2;
}

.app-screen-home .home-agent-card-art {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.86);
  border-radius: 13px;
  box-shadow: 0 4px 10px rgba(30, 16, 8, 0.12);
}

.app-screen-home .home-agent-card[data-creative-agent="creative-director"] .home-agent-card-art img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.app-screen-home .home-agent-live {
  min-height: 24px;
  padding: 0 8px;
  color: #4d3c31;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  font-size: 11px;
  font-weight: 700;
}

.app-screen-home .home-agent-card-copy {
  gap: 2px;
}

.app-screen-home .home-agent-card-copy small {
  color: var(--agent-accent);
  font-size: 11px;
}

.app-screen-home .home-agent-card-copy strong {
  color: #352820;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.app-screen-home .home-agent-card-copy > span {
  min-height: 31px;
  color: #786d65;
  font-size: 12px;
  line-height: 1.45;
}

.app-screen-home .home-agent-card-footer {
  gap: 6px;
  padding-top: 7px;
  border-top-color: #f0e8e1;
}

.app-screen-home .home-agent-card-footer em {
  color: #786d65;
  font-size: 12px;
}

.app-screen-home .home-agent-card-footer img {
  width: 14px;
  height: 14px;
  filter: none;
  opacity: 0.58;
}

@media (hover: hover) and (pointer: fine) {
  .app-screen-home .case-strip button:hover,
  .app-screen-home .home-recent-create:hover,
  .app-screen-home .home-agent-card:hover {
    transform: translateY(-2px);
    border-color: #e5c99f;
    box-shadow: 0 12px 24px rgba(74, 48, 25, 0.11);
  }

  .app-screen-home .home-agent-card:hover .home-agent-card-bg {
    filter: saturate(0.88) contrast(1);
    transform: scale(1.025);
  }
}

@media (max-width: 380px) {
  .app-screen-home .case-strip {
    gap: 7px;
  }

  .app-screen-home .case-strip button {
    height: 90px;
  }

  .app-screen-home .case-strip strong {
    font-size: 12px;
  }

  .app-screen-home .home-agent-intro {
    grid-template-columns: minmax(0, 1fr) 74px;
    min-height: 114px;
    padding-inline: 14px 10px;
  }

  .home-agent-intro-visual {
    width: 72px;
    height: 72px;
  }

  .home-agent-intro-visual img {
    width: 67px;
    height: 67px;
  }

  .app-screen-home .home-agent-intro strong {
    font-size: 14.5px;
  }

  .app-screen-home .home-agent-intro p {
    font-size: 12px;
  }

  .app-screen-home .home-agent-card {
    min-height: 176px;
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-screen-home .case-strip button,
  .app-screen-home .home-recent-create,
  .app-screen-home .home-agent-filters button,
  .app-screen-home .home-agent-card {
    transition: none;
  }
}

/* v119 works gallery: reference-matched, flat and mobile-first. */
#worksScreen {
  --works-gutter: 16px;
  color: #2b1b13;
  background: #fffaf4;
}

#worksScreen .works-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 80px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 11px;
  background: #fff1bd;
}

#worksScreen .works-page-heading {
  min-width: 0;
}

#worksScreen .works-page-heading h1 {
  margin: 0;
  color: #2a160e;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

#worksScreen .works-page-heading p {
  margin: 6px 0 0;
  color: #776b62;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
}

#worksScreen .works-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding-top: 1px;
  padding-bottom: 0;
}

#worksScreen .works-alert-button,
#worksScreen .works-avatar-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

#worksScreen .works-alert-button > img {
  width: 25px;
  height: 25px;
  filter: brightness(0) saturate(100%) opacity(0.86);
}

#worksScreen .works-alert-button > span {
  position: absolute;
  top: 5px;
  right: 4px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff1bd;
  border-radius: 50%;
  background: #ff4052;
}

#worksScreen .works-avatar-button {
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(85, 53, 19, 0.14);
}

#worksScreen .works-avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#worksScreen .works-page-content {
  display: block;
  padding: 0 0 calc(108px + env(safe-area-inset-bottom));
  scroll-padding-bottom: calc(108px + env(safe-area-inset-bottom));
}

#worksScreen #worksDiscoverySurface {
  display: grid;
  gap: 8px;
}

#worksScreen .works-feature-shell {
  min-width: 0;
  margin-top: -8px;
}

#worksScreen .works-feature-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 26px 3px;
  scroll-padding-inline: 26px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

#worksScreen .works-feature-track::-webkit-scrollbar {
  display: none;
}

#worksScreen .works-feature-card {
  position: relative;
  flex: 0 0 min(338px, calc(100vw - 52px));
  min-width: 0;
  height: auto;
  aspect-ratio: 1.69 / 1;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 16px;
  background: linear-gradient(145deg, #f6ecdf, #e7d4be);
  box-shadow: 0 5px 14px rgba(69, 43, 22, 0.10);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

#worksScreen .works-feature-image,
#worksScreen .works-feature-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#worksScreen .works-feature-image,
#worksScreen .works-showcase-image {
  opacity: 0;
  transition: opacity 180ms ease;
}

#worksScreen .works-media-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  color: #846f5d;
  background: rgba(255, 252, 247, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease, visibility 160ms ease;
}

#worksScreen .works-feature-shade,
#worksScreen .works-showcase-shade,
#worksScreen .works-feature-content,
#worksScreen .works-showcase-rank,
#worksScreen .works-showcase-favorite,
#worksScreen .works-showcase-open > span {
  opacity: 0;
  transition: opacity 160ms ease;
}

#worksScreen .is-media-ready > .works-feature-image,
#worksScreen .is-media-ready > .works-showcase-image {
  opacity: 1;
}

#worksScreen .is-media-ready > .works-media-fallback {
  visibility: hidden;
  opacity: 0;
}

#worksScreen .is-media-ready > .works-feature-shade,
#worksScreen .is-media-ready > .works-showcase-shade,
#worksScreen .is-media-ready > .works-feature-content,
#worksScreen .is-media-ready > .works-showcase-rank,
#worksScreen .is-media-ready > .works-showcase-favorite,
#worksScreen .is-media-ready > .works-showcase-open > span,
#worksScreen .is-media-error > .works-feature-shade,
#worksScreen .is-media-error > .works-showcase-shade,
#worksScreen .is-media-error > .works-feature-content,
#worksScreen .is-media-error > .works-showcase-rank,
#worksScreen .is-media-error > .works-showcase-favorite,
#worksScreen .is-media-error > .works-showcase-open > span {
  opacity: 1;
}

#worksScreen .is-media-error {
  background: linear-gradient(145deg, #9d7c5f, #584131);
}

#worksScreen .is-media-error > .works-media-fallback {
  top: 38%;
  color: #fff8ee;
  background: rgba(55, 38, 26, 0.44);
  border-color: rgba(255, 255, 255, 0.2);
}

#worksScreen .works-feature-card:not(.is-media-ready):not(.is-media-error) .works-feature-actions,
#worksScreen .works-showcase-card:not(.is-media-ready):not(.is-media-error) .works-showcase-open,
#worksScreen .works-showcase-card:not(.is-media-ready):not(.is-media-error) .works-showcase-favorite {
  pointer-events: none;
}

#worksScreen .works-feature-image img {
  object-fit: cover;
}

#worksScreen .works-feature-card[data-showcase-id="spring-feature"] > .works-feature-image {
  object-position: 59% 48%;
  filter: brightness(1.12) saturate(1.05);
  transform: scale(1.12);
  transform-origin: 59% 48%;
}

#worksScreen .works-feature-shade,
#worksScreen .works-showcase-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(38, 23, 14, 0.05);
}

#worksScreen .works-feature-shade {
  background: linear-gradient(180deg, transparent 34%, rgba(29, 18, 10, 0.12) 56%, rgba(29, 18, 10, 0.58) 100%);
  box-shadow: none;
}

#worksScreen .works-feature-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  color: #fff;
}

#worksScreen .works-feature-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 14px;
  color: #3a250f;
  background: #ffd052;
  font-size: 12px;
  font-weight: 800;
}

#worksScreen .works-feature-badge img {
  width: 14px;
  height: 14px;
}

#worksScreen .works-feature-copy {
  min-width: 0;
  max-width: 78%;
  text-shadow: 0 1px 8px rgba(26, 14, 7, 0.36);
}

#worksScreen .works-feature-copy h2 {
  margin: 0;
  color: inherit;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
}

#worksScreen .works-feature-copy p {
  margin: 4px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#worksScreen .works-feature-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

#worksScreen .works-feature-social {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 10.5px;
}

#worksScreen .works-feature-social > span {
  display: flex;
}

#worksScreen .works-feature-social img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
}

#worksScreen .works-feature-social img + img {
  margin-left: -6px;
}

#worksScreen .works-feature-social b {
  white-space: nowrap;
}

#worksScreen .works-feature-actions {
  display: flex;
  min-width: 0;
  padding: 2px;
  border-radius: 15px;
  background: rgba(30, 23, 17, 0.62);
  backdrop-filter: blur(8px);
}

#worksScreen .works-feature-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: transparent;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

#worksScreen .works-feature-actions img {
  width: 14px;
  height: 14px;
}

#worksScreen .works-feature-dots {
  display: flex;
  justify-content: center;
  gap: 0;
  height: 28px;
  margin-top: 0;
}

#worksScreen .works-feature-dots button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin-top: -8px;
  padding: 0;
  border: 0;
  place-items: center;
  background: transparent;
  transition: width 160ms ease;
}

#worksScreen .works-feature-dots button::after {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: #ded9d3;
  content: "";
  transition: width 160ms ease, background-color 160ms ease;
}

#worksScreen .works-feature-dots button.is-active {
  width: 48px;
}

#worksScreen .works-feature-dots button.is-active::after {
  width: 20px;
  background: #ff8a18;
}

#worksScreen .works-category-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 var(--works-gutter);
  scroll-padding-inline: var(--works-gutter);
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

#worksScreen .works-category-filter::-webkit-scrollbar {
  display: none;
}

#worksScreen .works-category-filter button {
  display: flex;
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 44px;
  height: 44px;
  padding: 0 13px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid #f2ede7;
  border-radius: 17px;
  color: #70665f;
  background: #f7f4ef;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

#worksScreen .works-category-filter button img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.78;
}

#worksScreen .works-category-filter button.is-active {
  color: #40270f;
  border-color: #ffd066;
  background: #ffd866;
  box-shadow: 0 4px 10px rgba(217, 151, 29, 0.12);
}

#worksScreen .works-category-filter button.is-active img {
  opacity: 1;
}

/* v165: narrow-screen content integrity and calmer inspiration hierarchy. */
#templatesScreen .template-library-media {
  width: 100%;
  min-height: 0;
  aspect-ratio: 4 / 5;
}

#templatesScreen .inspiration-trend-status {
  color: #8a7b6f;
  font-size: 11px;
}

@media (max-width: 374px) {
  .home-recent-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-recent-empty {
    grid-column: 1 / -1;
  }

  .home-recent-empty span {
    overflow: visible;
    white-space: normal;
  }

  #worksScreen .works-showcase-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #worksScreen .works-showcase-card {
    aspect-ratio: 1.48 / 1;
  }
}

#worksScreen .works-showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 var(--works-gutter);
}

#worksScreen .works-showcase-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1.28 / 1;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(145deg, #f6ecdf, #e7d4be);
  box-shadow: 0 4px 10px rgba(59, 38, 21, 0.09);
}

#worksScreen .works-showcase-image,
#worksScreen .works-showcase-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#worksScreen .works-showcase-image img {
  object-fit: cover;
}

#worksScreen .works-showcase-shade {
  background: linear-gradient(180deg, transparent 32%, rgba(26, 17, 10, 0.1) 55%, rgba(26, 17, 10, 0.6) 100%);
  box-shadow: none;
}

#worksScreen .works-showcase-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #ffd34e;
}

#worksScreen .works-showcase-rank img {
  width: 14px;
  height: 14px;
}

#worksScreen .works-showcase-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

#worksScreen .works-showcase-open > span {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  color: #3d2818;
  background: rgba(255, 248, 235, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(38, 23, 14, 0.12);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 800;
}

#worksScreen .works-showcase-copy {
  position: absolute;
  z-index: 2;
  right: 9px;
  bottom: 8px;
  left: 9px;
  min-width: 0;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 1px 7px rgba(24, 13, 7, 0.46);
}

#worksScreen .works-showcase-copy h3 {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#worksScreen .works-showcase-copy h3 img {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

#worksScreen .works-showcase-copy p {
  margin: 3px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#worksScreen .works-showcase-favorite {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: rgba(24, 18, 13, 0.5);
  font-size: 9.5px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

#worksScreen .works-showcase-favorite img {
  width: 14px;
  height: 14px;
}

#worksScreen .works-showcase-favorite.is-active {
  color: #fff2f4;
  background: rgba(225, 53, 72, 0.78);
}

#worksScreen .works-showcase-card:has(.works-showcase-favorite) .works-showcase-copy {
  right: 58px;
}

#worksScreen .works-personal-section {
  margin: 24px var(--works-gutter) 0;
  padding-top: 19px;
  border-top: 1px solid #eadfd5;
}

#worksScreen .works-personal-section > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

#worksScreen .works-personal-section > header span {
  color: var(--color-brand-strong, #a94808);
  font-size: 12px;
  font-weight: 600;
}

#worksScreen .works-personal-section > header h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: 0;
}

#worksScreen .works-personal-section > header button {
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  color: #8b7768;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

#worksScreen .work-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#worksScreen .work-list > li {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #eadfd5;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

#worksScreen .work-card-head,
#worksScreen .work-card-actions {
  padding-inline: 10px;
}

#worksScreen .works-draft-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px var(--works-gutter) 0;
  padding: 24px 0;
  border: 0;
  border-top: 1px solid #eadfd5;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#worksScreen .works-draft-empty[hidden] {
  display: none;
}

#worksScreen .empty-work-copy h2 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

#worksScreen .empty-work-copy p {
  margin: 6px 0 0;
  color: #80736a;
  font-size: 12px;
  line-height: 1.45;
}

#worksScreen .empty-work-actions {
  display: grid;
  gap: 7px;
  flex: 0 0 auto;
}

#worksScreen .empty-work-actions button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #efc997;
  border-radius: 10px;
  color: #8b4a18;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

#worksScreen .empty-work-actions button:first-child {
  color: #fff;
  border-color: #ff7c28;
  background: #ff7c28;
}

.phone-app[data-active-screen="works"] .bottom-nav button[data-open-screen="works"] img {
  filter: brightness(0) saturate(100%) invert(52%) sepia(97%) saturate(2872%) hue-rotate(352deg) brightness(103%) contrast(102%);
}

@media (hover: hover) and (pointer: fine) {
  #worksScreen .works-feature-actions button:hover,
  #worksScreen .works-category-filter button:hover,
  #worksScreen .works-showcase-favorite:hover {
    background-color: rgba(255, 255, 255, 0.18);
  }

  #worksScreen .works-category-filter button:hover {
    color: #3e2b1a;
    background: #fff0cf;
  }
}

@media (max-width: 360px) {
  #worksScreen {
    --works-gutter: 14px;
  }

  #worksScreen .works-page-header {
    min-height: 76px;
    padding-inline: 16px;
  }

  #worksScreen .works-page-heading h1 {
    font-size: 24px;
  }

  #worksScreen .works-page-heading p {
    max-width: 205px;
    font-size: 12px;
  }

  #worksScreen .works-header-actions {
    gap: 5px;
  }

  #worksScreen .works-alert-button,
  #worksScreen .works-avatar-button {
    width: 38px;
    height: 38px;
  }

  #worksScreen .works-feature-track {
    padding-inline: 24px;
    scroll-padding-inline: 24px;
  }

  #worksScreen .works-feature-content {
    padding: 11px;
  }

  #worksScreen .works-feature-copy {
    max-width: 88%;
  }

  #worksScreen .works-feature-copy h2 {
    font-size: 24px;
  }

  #worksScreen .works-feature-social b {
    display: block;
    font-size: 9.5px;
  }

  #worksScreen .works-feature-actions button {
    padding-inline: 5px;
    font-size: 9.5px;
  }

  #worksScreen .works-category-filter {
    gap: 4px;
  }

  #worksScreen .works-category-filter button {
    gap: 2px;
    font-size: 10.5px;
  }

  #worksScreen .works-category-filter button img {
    width: 15px;
    height: 15px;
  }

  #worksScreen .works-showcase-grid {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #worksScreen .works-feature-track {
    scroll-behavior: auto;
  }

  #worksScreen .works-feature-dots button {
    transition: none;
  }
}









/* v123 readable assistant replies */
#assistantPrompt.assistant-markdown,
.assistant-chat-log .assistant-markdown {
  margin: 0;
  color: #332d29;
  font-size: 13px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}
.assistant-markdown > :first-child { margin-top: 0; }
.assistant-markdown > :last-child { margin-bottom: 0; }
.assistant-markdown p { margin: 0 0 10px; }
.assistant-markdown h3,
.assistant-markdown h4 {
  margin: 18px 0 8px;
  color: #2c231d;
  font-weight: 900;
  line-height: 1.35;
}
.assistant-markdown h3 { font-size: 17px; }
.assistant-markdown h4 { font-size: 15px; }
.assistant-markdown strong { color: #30251e; font-weight: 900; }
.assistant-markdown ul,
.assistant-markdown ol {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
  padding-left: 21px;
}
.assistant-markdown li { padding-left: 2px; }
.assistant-markdown blockquote {
  margin: 10px 0;
  padding: 10px 12px;
  color: #76512f;
  background: #fff6e8;
  border-left: 3px solid #ff9b36;
  border-radius: 0 12px 12px 0;
}
.assistant-markdown code {
  padding: 2px 5px;
  color: #9a4e16;
  background: #fff1dc;
  border-radius: 5px;
  font-family: Consolas, monospace;
  font-size: 0.92em;
}
.assistant-markdown hr {
  height: 1px;
  margin: 14px 0;
  background: #f0ddc7;
  border: 0;
}
.assistant-markdown-table {
  max-width: 100%;
  margin: 12px 0 16px;
  overflow-x: auto;
  border: 1px solid #efd9be;
  border-radius: 14px;
  background: #fffdf9;
}
.assistant-markdown-table table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 12px;
}
.assistant-markdown-table th,
.assistant-markdown-table td {
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  border-right: 1px solid #f2e4d4;
  border-bottom: 1px solid #f2e4d4;
}
.assistant-markdown-table th {
  color: #7b461b;
  background: #fff3df;
  font-weight: 900;
}
.assistant-markdown-table tr:last-child td { border-bottom: 0; }
.assistant-markdown-table th:last-child,
.assistant-markdown-table td:last-child { border-right: 0; }
@media (max-width: 600px) {
  .assistant-markdown-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .assistant-markdown-table table,
  .assistant-markdown-table tbody,
  .assistant-markdown-table tr,
  .assistant-markdown-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .assistant-markdown-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .assistant-markdown-table tr {
    margin-bottom: 10px;
    padding: 10px 11px;
    background: #fffdf9;
    border: 1px solid #efd9be;
    border-radius: 13px;
  }
  .assistant-markdown-table td {
    display: grid;
    grid-template-columns: minmax(72px, 30%) minmax(0, 1fr);
    gap: 8px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px dashed #f0dfca;
  }
  .assistant-markdown-table td:last-child { border-bottom: 0; }
  .assistant-markdown-table td::before {
    content: attr(data-label);
    color: #a25d22;
    font-weight: 900;
  }
}

/* v124 full interaction audit fixes */
.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card > .reply-head,
.assistant-chat-log .reply-head {
  display: none;
}

#assistantScreen .assistant-feature-scroll {
  gap: 5px;
  padding-right: 18px;
  scroll-padding-inline: 8px 18px;
  overscroll-behavior-inline: contain;
}

#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"],
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="image"],
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="video"],
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="ppt"],
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="writing"],
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="more"] {
  flex: 0 0 58px;
  min-width: 58px;
  width: 58px;
  max-width: 58px;
  padding-inline: 2px;
  scroll-snap-align: start;
}

#assistantScreen .assistant-feature-scroll [data-assistant-shortcut="ppt"] img {
  width: 17px;
  height: 17px;
}

#assistantScreen .assistant-feature-scroll::after {
  content: "";
  flex: 0 0 1px;
}

#profileScreen .profile-avatar-source {
  background: #ffe3a0;
}

@media (max-width: 360px) {
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="quick"],
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="image"],
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="video"],
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="ppt"],
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="writing"],
  #assistantScreen .assistant-feature-scroll [data-assistant-shortcut="more"] {
    flex-basis: 56px;
    min-width: 56px;
    width: 56px;
    max-width: 56px;
  }
}

/* v135 final cascade lock: keep the conversation layout above legacy version layers */
.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card,
#assistantScreen .assistant-chat-turn .reply-card {
  display: grid;
  gap: 7px;
  width: 100%;
}

.phone-app.has-assistant-reply #assistantScreen > .assistant-content > .reply-card > .reply-head,
#assistantScreen .assistant-chat-log .reply-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0 4px;
}

#assistantScreen .reply-head > img,
#assistantScreen .assistant-chat-log .reply-head > img {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: cover;
  background: #fff3d2;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #f3c969, 0 7px 16px rgba(95, 63, 28, 0.13);
}

#assistantScreen .reply-head #assistantReplyLead,
#assistantScreen .assistant-chat-log .reply-head p {
  margin: 0;
  color: #8b796d;
  font-size: 11px;
  line-height: 1.38;
}

#assistantScreen .prompt-card,
#assistantScreen .assistant-chat-turn .prompt-card {
  display: grid;
  gap: 10px;
  width: calc(100% - 46px);
  margin-left: 46px;
  padding: 13px 14px 14px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #eadfd2;
  border-radius: 7px 20px 20px 20px;
  box-shadow: 0 10px 24px rgba(76, 52, 29, 0.08);
}

#assistantScreen .prompt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#assistantScreen .prompt-card-head h2,
#assistantScreen .prompt-card-head button,
#assistantScreen .prompt-card #assistantPrompt,
#assistantScreen .assistant-chat-turn .prompt-card p {
  grid-row: auto;
}

#assistantScreen .prompt-card-head h2 {
  min-width: 0;
  font-size: 13px;
}

#assistantScreen .prompt-card-head button {
  min-height: 36px;
  padding-inline: 11px;
  color: #9a641d;
  background: #fff8eb;
  border: 1px solid #eed8b8;
  box-shadow: none;
  font-size: 11px;
}

#assistantPrompt.assistant-markdown,
.assistant-chat-log .assistant-markdown {
  color: #3d342e;
  font-size: 14px;
  line-height: 1.72;
}

#assistantScreen .reply-card.is-thinking .prompt-card-head {
  display: none;
}

#assistantScreen .reply-card.is-thinking .prompt-card {
  width: auto;
  justify-self: start;
  padding: 12px 15px;
  border-radius: 7px 18px 18px 18px;
}

#assistantScreen .action-grid,
.phone-app.has-assistant-reply #assistantScreen .action-grid {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 4px 46px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

#assistantScreen .action-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 13px;
  border-radius: 999px;
  scroll-snap-align: start;
  font-size: 12px;
}

#assistantScreen .action-grid img {
  width: 17px;
  height: 17px;
}

#worksScreen .work-list {
  grid-template-columns: minmax(0, 1fr);
}

/* Text-zoom safety: at 200% browser zoom the effective CSS viewport can be
   narrower than a physical phone. Let information reflow instead of clipping. */
@media (max-width: 280px) {
  #templatesScreen .template-page-tabs,
  #templatesScreen .template-page-tabs:not(.is-expanded) {
    flex-wrap: wrap;
    overflow: visible;
  }

  #templatesScreen .template-page-tabs:not(.is-expanded) button:nth-child(n + 4) {
    display: none;
  }

  #templatesScreen .inspiration-action-grid,
  #templatesScreen .template-page-grid,
  #worksScreen .works-showcase-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .template-trend-badge {
    max-width: calc(100% - 54px);
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  #worksScreen .works-showcase-copy h3,
  #worksScreen .works-showcase-copy p {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  #profileScreen .profile-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final reduced-motion guard: deliberately last in the cascade. */
#templatesScreen .template-trend-badge {
  color: #6c4931;
  background: rgba(255, 250, 244, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: 0 3px 10px rgba(49, 31, 19, 0.1);
  backdrop-filter: blur(8px);
}

#templatesScreen .template-library-actions button,
#templatesScreen .template-library-actions button:first-child {
  color: #8c4c18;
  background: #fff2dc;
  border: 1px solid rgba(223, 173, 104, 0.42);
  border-radius: 999px;
  box-shadow: none;
  font-weight: 750;
}

/* v176: full-screen work preview and direct copy actions. */
.work-preview-shell {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  color: #fffaf4;
  background: rgba(20, 15, 11, 0.97);
}

.work-preview-shell[hidden] {
  display: none;
}

.work-preview-dialog {
  display: grid;
  min-width: 0;
  min-height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
}

.work-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 12px;
}

.work-preview-head > div {
  min-width: 0;
}

.work-preview-head span {
  color: #ffb13b;
  font-size: 11px;
  font-weight: 850;
}

.work-preview-head h2 {
  margin: 3px 0 0;
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-preview-head button {
  flex: 0 0 auto;
  min-width: 54px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 750;
}

.work-preview-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  place-items: center;
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.035) 75%),
    #0e0b09;
  background-size: 20px 20px;
  touch-action: pinch-zoom;
}

.work-preview-stage img,
.work-preview-stage video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 156px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  object-fit: contain;
}

.work-preview-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
}

.work-preview-actions button {
  min-width: 0;
  min-height: 48px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 800;
}

.work-preview-actions .primary {
  color: #2d1b08;
  border-color: #ffbd45;
  background: #ffb326;
}

.work-card-media-open,
.work-detail-media-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
}

.work-card-media-open > span,
.work-detail-media-open > span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 999px;
  color: #fff;
  background: rgba(28, 20, 14, 0.68);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 800;
}

#worksScreen .works-feature-content,
#worksScreen .works-showcase-copy {
  z-index: 2;
  pointer-events: none;
}

#worksScreen .works-feature-actions,
#worksScreen .works-feature-actions button,
#worksScreen .works-showcase-open,
#worksScreen .works-showcase-favorite,
#worksScreen .works-showcase-copy-action {
  pointer-events: auto;
}

#worksScreen .works-feature-preview {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  min-width: 54px;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  color: #fff;
  background: rgba(39, 27, 17, 0.62);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 800;
}

#worksScreen .works-showcase-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  border: 0;
  background: transparent;
}

#worksScreen .works-showcase-preview > span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 999px;
  color: #fff;
  background: rgba(40, 27, 17, 0.62);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 800;
}

#worksScreen .works-showcase-open,
#worksScreen .works-showcase-favorite,
#worksScreen .works-showcase-copy-action {
  z-index: 3;
}

#worksScreen .works-showcase-copy-action {
  position: absolute;
  top: 44px;
  right: 8px;
  min-width: 48px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  color: #fff;
  background: rgba(42, 28, 18, 0.64);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 360px) {
  .work-preview-actions {
    grid-template-columns: 1fr;
  }

  .work-preview-stage img,
  .work-preview-stage video {
    max-height: calc(100dvh - 260px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body,
  .phone-app,
  .phone-app * {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* v193 · composer geometry lock: shortcuts stay pill-shaped and add stays circular. */
#assistantScreen .assistant-feature-scroll [data-assistant-shortcut] {
  border-radius: 999px;
}

#assistantScreen .assistant-feature-scroll .assistant-add-reference {
  border-radius: 50%;
}

/* v194 · breed atlas: a specimen-led, mobile-first prompt workspace. */
.home-action-grid [data-open-screen="breeds"] .home-action-art {
  background: #e9f7ee;
}

.home-action-grid [data-open-screen="breeds"] .home-action-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tool-list [data-tool-tone="breed"] {
  grid-column: 1 / -1;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 11px;
  min-height: 106px;
  padding: 13px;
  background: #edf8f0;
  border-color: #d2ead9;
}

.tool-list [data-tool-tone="breed"]::after {
  display: none;
}

.tool-list [data-tool-tone="breed"] img {
  width: 52px;
  height: 52px;
  padding: 10px;
  background: #fff;
}

.tool-list [data-tool-tone="breed"] span {
  max-width: none;
  margin: 0;
}

.tool-list [data-tool-tone="breed"] strong {
  margin: 0;
  color: #193b2d;
  font-size: 17px;
}

.tool-list [data-tool-tone="breed"] small {
  display: block;
  margin-top: 5px;
  color: #5e746a;
  font-size: 11px;
  line-height: 1.4;
}

.tool-list [data-tool-tone="breed"] > b {
  color: #237b55;
  font-size: 12px;
}

.phone-app[data-active-screen="breeds"] > .bottom-nav {
  display: none;
}

#breedPromptScreen {
  min-height: 100dvh;
  color: #27241f;
  background: #f4f1e9;
}

#breedPromptScreen button,
#breedPromptScreen input,
#breedPromptScreen select,
#breedPromptScreen textarea {
  font: inherit;
}

.breed-prompt-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: calc(70px + env(safe-area-inset-top));
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(244, 241, 233, 0.94);
  border-bottom: 1px solid rgba(93, 77, 56, 0.12);
  backdrop-filter: blur(18px);
}

.breed-prompt-topbar .back-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid #ddd4c5;
  border-radius: 15px;
  background: #fffdf9;
}

.breed-prompt-topbar .back-button::before {
  position: absolute;
  top: 15px;
  left: 17px;
  width: 10px;
  height: 10px;
  content: "";
  border-bottom: 2px solid #302b24;
  border-left: 2px solid #302b24;
  transform: rotate(45deg);
}

.breed-prompt-topbar > div {
  min-width: 0;
}

.breed-prompt-topbar > div > span,
.breed-atlas-kicker,
.breed-generate-panel > div > span,
.breed-result-panel > header span {
  display: block;
  color: #2f7756;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.25px;
}

.breed-prompt-topbar h1 {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.breed-reset-button {
  min-width: 52px;
  min-height: 44px;
  padding: 0 12px;
  color: #61584c;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.breed-prompt-content {
  display: grid;
  gap: 13px;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 12px 14px calc(32px + env(safe-area-inset-bottom));
}

.breed-atlas-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 14px;
  min-height: 192px;
  overflow: hidden;
  padding: 20px 17px;
  color: #fffdf7;
  background: #243f34;
  border-radius: 28px;
  box-shadow: 0 18px 34px rgba(38, 60, 50, 0.18);
}

.breed-atlas-hero > div {
  align-self: center;
  min-width: 0;
}

.breed-atlas-hero .breed-atlas-kicker {
  color: #aee5c8;
  font-family: var(--font);
  line-height: 1.4;
  letter-spacing: 0.2px;
}

.breed-atlas-hero h2 {
  margin: 10px 0 0;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -1px;
}

.breed-atlas-hero h2 b {
  display: block;
  color: #f6cc78;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-style: italic;
  line-height: 0.9;
}

.breed-atlas-hero p {
  margin: 11px 0 0;
  color: rgba(255, 253, 247, 0.76);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.breed-atlas-hero figure {
  position: relative;
  align-self: stretch;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: #dfe8d8;
  border: 4px solid rgba(255, 255, 255, 0.82);
  border-radius: 58px 58px 18px 18px;
}

.breed-atlas-hero figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.breed-atlas-hero figcaption {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  padding: 8px;
  color: #fff;
  background: rgba(25, 42, 35, 0.82);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.breed-atlas-hero figcaption span,
.breed-atlas-hero figcaption strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breed-atlas-hero figcaption span {
  color: #bce8ce;
  font-size: 9px;
  font-weight: 800;
}

.breed-atlas-hero figcaption strong {
  margin-top: 2px;
  font-size: 11px;
}

.breed-step-card,
.breed-result-panel {
  padding: 16px;
  background: #fffdfa;
  border: 1px solid #e8dfd1;
  border-radius: 23px;
  box-shadow: 0 10px 24px rgba(73, 57, 37, 0.07);
}

.breed-step-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.breed-step-head > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #286b4d;
  background: #e6f3e9;
  border-radius: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
  font-weight: 800;
}

.breed-step-head h2,
.breed-step-head p {
  margin: 0;
}

.breed-step-head h2 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.35px;
}

.breed-step-head p {
  margin-top: 3px;
  color: #81786c;
  font-size: 11px;
  line-height: 1.35;
}

.breed-species-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.breed-species-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 54px;
  padding: 8px;
  color: #4e493f;
  background: #f4f0e8;
  border: 1px solid transparent;
  border-radius: 16px;
  text-align: left;
}

.breed-species-tabs button > b {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #715f48;
  background: #fff;
  border-radius: 11px;
  font-size: 13px;
}

.breed-species-tabs button span,
.breed-species-tabs button small {
  display: block;
}

.breed-species-tabs button span {
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
}

.breed-species-tabs button small {
  margin-top: 1px;
  color: #948a7d;
  font-size: 9px;
  font-weight: 700;
}

.breed-species-tabs button.is-active {
  color: #18573d;
  background: #e5f3e9;
  border-color: #91c8a7;
  box-shadow: inset 0 0 0 1px rgba(37, 116, 79, 0.08);
}

.breed-species-tabs button.is-active > b {
  color: #fff;
  background: #2f7b58;
}

.breed-search {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 12px;
  background: #f5f1ea;
  border: 1px solid #e3dbcf;
  border-radius: 15px;
}

.breed-search img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

.breed-search input {
  min-width: 0;
  height: 46px;
  padding: 0;
  color: #292720;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.breed-search button {
  min-height: 40px;
  padding: 0 4px;
  color: #2f7756;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.breed-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 318px;
  margin-top: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.breed-option-grid button {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 60px;
  padding: 9px 10px;
  color: #3d382f;
  background: #faf7f1;
  border: 1px solid #eee6dc;
  border-radius: 14px;
  text-align: left;
}

.breed-option-grid button strong,
.breed-option-grid button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breed-option-grid button strong {
  font-size: 13px;
  font-weight: 900;
}

.breed-option-grid button small {
  margin-top: 3px;
  color: #94897b;
  font-size: 9px;
}

.breed-option-grid button.is-active {
  color: #164d38;
  background: #e8f4eb;
  border-color: #7fbd98;
  box-shadow: inset 4px 0 0 #2f7b58;
}

.breed-empty-result {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px 10px;
  color: #8a8175;
  text-align: center;
  font-size: 12px;
}

.breed-content-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.breed-content-types button {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 76px;
  padding: 9px 5px;
  color: #514a40;
  background: #f8f4ed;
  border: 1px solid transparent;
  border-radius: 15px;
}

.breed-content-types button b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #725f47;
  background: #eee5d8;
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
}

.breed-content-types button span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breed-content-types button.is-active {
  color: #174d38;
  background: #e7f3ea;
  border-color: #83be9b;
}

.breed-content-types button.is-active b {
  color: #fff;
  background: #2f7b58;
}

.breed-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 9px;
  margin-top: 15px;
}

.breed-field-grid label,
.breed-advanced-details label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.breed-field-grid label > span,
.breed-advanced-details label > span,
.breed-result-block > span {
  color: #696156;
  font-size: 11px;
  font-weight: 800;
}

.breed-field-grid input,
.breed-field-grid select,
.breed-advanced-details input,
.breed-advanced-details textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 11px;
  color: #302d27;
  background: #f8f5ef;
  border: 1px solid #e5ded3;
  border-radius: 13px;
  outline: 0;
  font-size: 13px;
}

.breed-field-grid select {
  padding-right: 24px;
}

.breed-field-grid input:focus,
.breed-field-grid select:focus,
.breed-advanced-details input:focus,
.breed-advanced-details textarea:focus,
.breed-search:focus-within {
  border-color: #5fa77e;
  box-shadow: 0 0 0 3px rgba(65, 142, 99, 0.12);
}

.breed-advanced-details {
  margin-top: 14px;
  border-top: 1px solid #ece4d8;
}

.breed-advanced-details summary {
  min-height: 48px;
  padding: 15px 2px 0;
  color: #365f4c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.breed-advanced-details summary span {
  margin-left: 5px;
  color: #938a7c;
  font-size: 10px;
  font-weight: 700;
}

.breed-advanced-details > div {
  display: grid;
  gap: 11px;
  padding-top: 12px;
}

.breed-advanced-details textarea {
  min-height: 88px;
  padding-top: 10px;
  line-height: 1.5;
  resize: vertical;
}

.breed-advanced-details .breed-negative-toggle {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 11px;
  background: #edf6ef;
  border-radius: 13px;
}

.breed-negative-toggle input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  padding: 0;
  accent-color: #2f7b58;
}

.breed-generate-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: #fff;
  background: #1f312a;
  border-radius: 23px;
  box-shadow: 0 16px 30px rgba(34, 53, 45, 0.2);
}

.breed-generate-panel h2,
.breed-generate-panel p {
  margin: 0;
}

.breed-generate-panel h2 {
  margin-top: 5px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}

.breed-generate-panel p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  line-height: 1.35;
}

.breed-generate-panel button {
  min-height: 52px;
  padding: 0 12px;
  color: #293024;
  background: #f7c968;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
  font-size: 13px;
  font-weight: 950;
}

.breed-result-panel {
  scroll-margin-top: calc(82px + env(safe-area-inset-top));
  border-color: #b9d7c5;
  box-shadow: 0 16px 34px rgba(42, 91, 65, 0.12);
}

.breed-result-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.breed-result-panel > header h2 {
  margin: 4px 0 0;
  font-size: 19px;
}

.breed-result-panel > header > button {
  min-width: 80px;
  min-height: 44px;
  color: #276e4e;
  background: #e8f4eb;
  border: 1px solid #b9d8c5;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 900;
}

.breed-result-block {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.breed-result-block textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  color: #302d27;
  background: #f7f4ed;
  border: 1px solid #ded7cc;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.65;
  resize: vertical;
}

#breedNegativeBlock textarea {
  min-height: 96px;
}

.breed-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.breed-result-actions button {
  min-height: 49px;
  padding: 0 9px;
  color: #315b47;
  background: #edf4ef;
  border: 1px solid #c9ddd0;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 900;
}

.breed-result-actions button.primary {
  color: #fff;
  background: #2f7b58;
  border-color: #2f7b58;
}

#breedPromptScreen button:focus-visible,
#breedPromptScreen input:focus-visible,
#breedPromptScreen select:focus-visible,
#breedPromptScreen textarea:focus-visible,
.tool-list [data-tool-tone="breed"]:focus-visible,
.home-action-grid [data-open-screen="breeds"]:focus-visible {
  outline: 3px solid rgba(47, 123, 88, 0.34);
  outline-offset: 2px;
}

@media (max-width: 370px) {
  .breed-prompt-content {
    padding-right: 11px;
    padding-left: 11px;
  }

  .breed-atlas-hero {
    grid-template-columns: minmax(0, 1fr) 98px;
  }

  .breed-species-tabs,
  .breed-content-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .breed-field-grid {
    grid-template-columns: 1fr;
  }

  .breed-generate-panel {
    grid-template-columns: 1fr;
  }

  .breed-generate-panel button {
    width: 100%;
  }
}

/* v207 · diversified Seedance 2.0 production library and two new account styles */
#templatesScreen .inspiration-today p {
  max-width: 232px;
}

#templatesScreen .template-type-filter {
  display: flex;
  min-width: 0;
  gap: 7px;
  margin: 10px -2px 2px;
  padding: 2px 2px 9px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: inline proximity;
  -webkit-overflow-scrolling: touch;
}

#templatesScreen .template-type-filter::-webkit-scrollbar {
  display: none;
}

#templatesScreen .template-type-filter button {
  position: relative;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  color: #62554d;
  background: #fffaf5;
  border: 1px solid #dfd1c5;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(72, 46, 31, 0.05);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  scroll-snap-align: start;
}

#templatesScreen .template-type-filter button.is-active,
#templatesScreen .template-type-filter button[aria-pressed="true"] {
  color: #fff;
  background:
    linear-gradient(90deg, #22ddd3 0 30%, transparent 30% 36%, #ff365f 36% 100%) bottom / 100% 3px no-repeat,
    #201816;
  border-color: #201816;
  box-shadow: 0 7px 14px rgba(32, 24, 22, 0.16);
}

#templatesScreen .template-type-filter button:focus-visible {
  outline: 3px solid rgba(34, 221, 211, 0.3);
  outline-offset: 2px;
}

.template-detail-sheet.is-prompt-template .template-detail-analysis:not([hidden]) {
  position: relative;
  display: grid;
  gap: 6px;
  padding-left: 16px;
  background: #eff8fb;
  border-color: #c8e3e9;
}

.template-detail-sheet.is-prompt-template .template-detail-analysis::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  background: #2bb8c8;
  border-radius: 0 4px 4px 0;
  content: "";
}

.template-detail-sheet.is-prompt-template .template-detail-analysis p {
  color: #3c5156;
  font-size: 12px;
  line-height: 1.68;
  white-space: pre-line;
}

.template-detail-evidence {
  padding: 11px 12px;
  background: #f7f2ec;
  border: 1px dashed #d8cabf;
  border-radius: 13px;
}

.template-detail-evidence:has(> p:empty) {
  padding-top: 9px;
}

.template-detail-evidence > .template-detail-source {
  margin: 0;
  color: #6d5f56;
  line-height: 1.55;
}

.template-detail-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.template-detail-source-links:not(:has(.template-detail-source:not([hidden]))) {
  display: none;
}

.template-detail-source-links .template-detail-source:not([hidden]) {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin: 0;
  padding: 0 10px;
  color: #273f43;
  background: #e7f5f5;
  border: 1px solid #b9dddd;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 850;
  text-decoration: none;
}

.template-detail-source-links .template-detail-source:focus-visible {
  outline: 3px solid rgba(34, 221, 211, 0.3);
  outline-offset: 2px;
}

/* In-app template video preview */
.template-video-preview {
  gap: 9px !important;
  padding: 10px !important;
  overflow: hidden;
  background: #171719 !important;
  border-color: #2f3035 !important;
  border-radius: 14px !important;
}

.template-video-preview[hidden] {
  display: none !important;
}

.template-video-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-video-preview-heading h3 {
  color: #fff !important;
  font-size: 12px !important;
}

.template-video-preview-heading span {
  padding: 4px 7px;
  color: #183f3b;
  background: #64eadb;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.template-video-preview video {
  display: block;
  width: 100%;
  max-height: min(52dvh, 430px);
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
  border-radius: 10px;
}

.template-video-preview-status {
  color: #d5d6dc !important;
  font-size: 10px !important;
  text-align: center;
}

.template-detail-actions.has-video-preview {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.template-detail-sheet .template-detail-actions .template-detail-preview-action {
  color: #fff;
  background: #171719;
  border-color: #171719;
}

.template-detail-sheet.is-prompt-template .template-detail-actions .template-detail-preview-action {
  color: #171719;
  background: var(--prompt-cyan);
  border-color: #21c9b7;
}

.template-library-actions [data-template-action="preview"] {
  color: #fff;
  background: #24252a;
  border-color: #24252a;
}

#templatesScreen .template-library-actions.has-video-preview {
  gap: 6px;
}

#templatesScreen .template-library-actions.has-video-preview button,
#templatesScreen .template-library-actions.has-video-preview button:first-child {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding-inline: 4px;
  font-size: 11px;
}

.template-variable-section {
  gap: 10px !important;
  background: #fff8e9 !important;
  border-color: #ecc984 !important;
}

.template-variable-section[hidden] {
  display: none !important;
}

.template-variable-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-variable-heading > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #70420d;
  background: #ffe4a9;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.template-variable-heading > span[data-complete="true"] {
  color: #164d45;
  background: #c9f3e9;
}

.template-variable-section > p {
  color: #6f5a3d !important;
  font-size: 11px !important;
  line-height: 1.55 !important;
}

.template-variable-fields {
  display: grid;
  gap: 10px;
}

.template-variable-fields label {
  display: grid;
  gap: 5px;
}

.template-variable-fields label > span {
  color: #3c3328;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.template-variable-fields input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: #25211d;
  background: #fff;
  border: 1px solid #d8b76f;
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
}

.template-variable-fields input[aria-invalid="true"] {
  background: #fff4f1;
  border-color: #c64a35;
  box-shadow: 0 0 0 3px rgba(198, 74, 53, 0.12);
}

.template-variable-fields input:focus-visible {
  outline: 3px solid rgba(34, 221, 211, 0.3);
  outline-offset: 2px;
}
.template-reference-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 5px;
}

.template-reference-actions[hidden] {
  display: none;
}

.template-reference-actions button {
  min-width: 0;
  min-height: 44px;
  padding: 4px 7px;
  color: #16413c;
  background: #d7f7f1;
  border: 1px solid #91dacf;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.template-seedance-section {
  gap: 10px !important;
  background: #171719 !important;
  border-color: #303136 !important;
  border-radius: 15px !important;
}

.template-seedance-section[hidden] {
  display: none !important;
}

.template-seedance-section .template-prompt-heading h3 {
  color: #64eadb !important;
  font-size: 12px !important;
  letter-spacing: 0.04em;
}

.template-seedance-section .template-prompt-heading > span {
  padding: 4px 8px;
  color: #171719;
  background: #64eadb;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.template-seedance-material-plan {
  padding: 9px 10px;
  color: #e8e8ec !important;
  background: #28292e;
  border-radius: 9px;
  font-size: 10.5px !important;
  line-height: 1.55 !important;
}

.template-seedance-segments {
  display: grid;
  gap: 9px;
}

.template-seedance-segments article {
  overflow: hidden;
  background: #fff;
  border: 1px solid #3a3b42;
  border-radius: 11px;
}

.template-seedance-segments article > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  background: #f1fffc;
  border-bottom: 1px solid #cceee8;
}

.template-seedance-segments article > header > div {
  display: grid;
  gap: 2px;
}

.template-seedance-segments article > header strong {
  color: #171719;
  font-size: 11px;
}

.template-seedance-segments article > header span {
  color: #5b625f;
  font-size: 9px;
  font-weight: 760;
}

.template-seedance-segments article > header button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 10px;
  color: #fff;
  background: #202125;
  border: 0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.template-seedance-segment-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.template-seedance-segment-actions button:last-child {
  color: #171719;
  background: #64eadb;
}

.template-seedance-segments pre {
  max-height: 330px;
  margin: 0;
  overflow: auto;
  padding: 11px;
  color: #303238;
  background: #fff;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  user-select: text;
}

@media (max-width: 370px) {
  .template-reference-actions {
    grid-template-columns: 1fr 1fr;
  }

  .template-reference-actions button:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 370px) {
  #templatesScreen .template-type-filter {
    margin-right: -1px;
    margin-left: -1px;
  }

  #templatesScreen .template-type-filter button {
    min-height: 36px;
    padding-inline: 11px;
  }
}

/* v224 · verified Douyin covers and locally imported workflow templates */
#templatesScreen .external-template-platform {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  color: #f8f8f5;
  background:
    radial-gradient(circle at 88% 4%, rgba(255, 54, 95, 0.24), transparent 33%),
    radial-gradient(circle at 4% 100%, rgba(34, 221, 211, 0.18), transparent 36%),
    #19191c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 14px 28px rgba(33, 26, 23, 0.14);
}

#templatesScreen .external-template-platform > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#templatesScreen .external-template-platform > header div {
  min-width: 0;
}

#templatesScreen .external-template-platform > header span,
#templatesScreen .external-template-platform > header h2,
#templatesScreen .external-template-platform > header p {
  margin: 0;
}

#templatesScreen .external-template-platform > header div > span {
  color: #4ee2d4;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

#templatesScreen .external-template-platform > header h2 {
  margin-top: 4px;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.25;
}

#templatesScreen .external-template-platform > header p {
  max-width: 260px;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10.5px;
  line-height: 1.55;
}

#templatesScreen .external-platform-mark {
  flex: 0 0 auto;
  padding: 7px 9px;
  color: #1d1d20;
  background: #fff;
  border-radius: 999px;
  box-shadow: 3px 3px 0 #ff365f, -2px -2px 0 #22ddd3;
  font-size: 10px;
  font-weight: 950;
}

#templatesScreen .external-template-platform-grid {
  display: grid;
  grid-auto-columns: min(78vw, 290px);
  grid-auto-flow: column;
  gap: 10px;
  margin-right: -15px;
  padding: 1px 15px 5px 1px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

#templatesScreen .external-template-platform-grid::-webkit-scrollbar {
  display: none;
}

#templatesScreen .external-template-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  grid-template-rows: minmax(82px, auto) 40px;
  gap: 9px 11px;
  min-width: 0;
  padding: 9px;
  color: #29272a;
  background: #fffaf3;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 17px;
  scroll-snap-align: start;
}

#templatesScreen .external-template-card > img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  background: #eee8df;
  border-radius: 12px;
}

#templatesScreen .external-template-card > div {
  display: grid;
  align-content: start;
  min-width: 0;
}

#templatesScreen .external-template-card span {
  width: fit-content;
  padding: 3px 6px;
  color: #185952;
  background: #dff9f5;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 900;
}

#templatesScreen .external-template-card strong {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

#templatesScreen .external-template-card p {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  color: #6f6660;
  font-size: 9.5px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#templatesScreen .external-template-card small {
  margin-top: 4px;
  color: #b4562e;
  font-size: 8.5px;
  font-weight: 850;
}

#templatesScreen .external-template-card > button {
  grid-column: 1 / -1;
  min-height: 40px;
  color: #fff;
  background: #222225;
  border: 0;
  border-radius: 11px;
  box-shadow: inset 3px 0 0 #22ddd3, inset -3px 0 0 #ff365f;
  font-size: 11px;
  font-weight: 900;
}

#templatesScreen .imported-template-platform .external-platform-mark {
  color: #174e48;
  background: #e8fff9;
  box-shadow: 3px 3px 0 #ffb56d, -2px -2px 0 #22ddd3;
}

#templatesScreen .external-template-card.is-imported-template {
  border-color: rgba(34, 221, 211, 0.24);
  box-shadow: 0 8px 18px rgba(5, 10, 12, 0.16);
}

#templatesScreen .external-template-card.is-imported-template small {
  display: -webkit-box;
  overflow: hidden;
  color: #8f4a25;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

#templatesScreen .external-template-card.is-imported-template > button {
  cursor: pointer;
  background: linear-gradient(105deg, #183c39 0%, #222225 52%, #402226 100%);
}

#templatesScreen .external-template-card.is-imported-template > button:focus-visible {
  outline: 3px solid rgba(255, 181, 109, 0.8);
  outline-offset: 2px;
}

#templatesScreen .template-library-card {
  grid-template-rows: auto auto 58px;
  min-height: 0;
  overflow: hidden;
}

#templatesScreen .template-library-media {
  min-height: 0;
  aspect-ratio: 3 / 4;
  background: #ece5dd;
}

#templatesScreen .template-library-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px 7px;
  background: #fff;
}

#templatesScreen .template-library-copy > strong,
#templatesScreen .template-library-copy > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#templatesScreen .template-library-copy > strong {
  color: #241b18;
  font-size: 13px;
  font-weight: 950;
}

#templatesScreen .template-library-copy > small {
  color: #756a64;
  font-size: 9px;
  font-weight: 750;
}

#templatesScreen .template-library-proof-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

#templatesScreen .template-library-proof-row.is-favorite-only {
  justify-content: flex-end;
}

#templatesScreen .template-proof-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 21px;
  align-items: center;
  padding: 0 7px;
  overflow: hidden;
  color: #6d5d55;
  background: #f3eee9;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#templatesScreen .template-proof-badge.is-verified {
  color: #fff;
  background:
    linear-gradient(90deg, #22ddd3 0 8%, transparent 8% 92%, #ff365f 92% 100%),
    #222225;
  padding-inline: 10px;
}

#templatesScreen .template-library-copy .template-favorite-button {
  position: static;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  color: #352b27;
  background: #f5f0eb;
  border: 1px solid #ded3ca;
  border-radius: 50%;
  box-shadow: none;
  font-size: 12px;
  backdrop-filter: none;
}

#templatesScreen .template-library-copy .template-favorite-button[aria-pressed="true"] {
  color: #fff;
  background: #ff365f;
  border-color: #ff365f;
}

#templatesScreen .template-library-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 6px;
  overflow: hidden;
  border-top: 1px solid #eee5dd;
}

#templatesScreen .template-library-actions.has-video-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#templatesScreen .template-library-actions > button,
#templatesScreen .template-library-actions.has-video-preview > button,
#templatesScreen .template-library-actions.has-video-preview > button:first-child {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding-inline: 3px;
  overflow: hidden;
  font-size: clamp(10.5px, 2.7vw, 11.5px);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#templatesScreen .template-page-content {
  padding-bottom: calc(var(--nav-height) + 64px + env(safe-area-inset-bottom));
  scroll-padding-bottom: calc(var(--nav-height) + 64px + env(safe-area-inset-bottom));
}

#templatesScreen .template-library-card.is-douyin-verified {
  border-color: #d8d0c9;
  box-shadow: 0 10px 22px rgba(40, 31, 28, 0.12);
}

#templatesScreen .template-library-card.is-douyin-verified .template-library-media img,
#templatesScreen .inspiration-action-grid > button > img {
  object-fit: cover;
}

@media (max-width: 370px) {
  #templatesScreen .external-template-platform {
    padding: 13px;
  }

  #templatesScreen .external-template-platform-grid {
    grid-auto-columns: min(82vw, 270px);
    margin-right: -13px;
    padding-right: 13px;
  }

  #templatesScreen .template-library-copy {
    padding-inline: 7px;
  }

  #templatesScreen .template-library-copy > strong {
    font-size: 12px;
  }
}

/* v216 personal works album: the profile entry opens a compact, image-first library. */
#worksScreen[data-works-view="album"] .works-personal-section {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

#worksScreen[data-works-view="album"] .work-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#worksScreen[data-works-view="album"] .work-list > li {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  overflow: hidden;
  border-radius: 16px;
}

#worksScreen[data-works-view="album"] .work-card-preview {
  grid-row: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f6eee5;
}

#worksScreen[data-works-view="album"] .work-card-preview > *,
#worksScreen[data-works-view="album"] .work-card-media-open,
#worksScreen[data-works-view="album"] .work-card-preview img,
#worksScreen[data-works-view="album"] .work-card-preview video {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
}

#worksScreen[data-works-view="album"] .work-card-head {
  position: relative;
  display: block;
  grid-row: 2;
  min-height: 62px;
  padding: 10px 38px 10px 10px;
}

#worksScreen[data-works-view="album"] .work-title-block strong {
  font-size: 13px;
  line-height: 1.25;
}

#worksScreen[data-works-view="album"] .work-meta {
  margin-top: 4px;
  overflow: hidden;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#worksScreen[data-works-view="album"] .work-card-open {
  position: absolute;
  top: 10px;
  right: 7px;
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  color: #9a5b20;
  background: transparent;
  border: 0;
  border-radius: 10px;
}

#worksScreen[data-works-view="album"] .work-card-open img {
  width: 16px;
  height: 16px;
}

#worksScreen[data-works-view="album"] .work-card-head > .ai-content-badge,
#worksScreen[data-works-view="album"] .work-card-head > .work-status-pill,
#worksScreen[data-works-view="album"] .work-card-actions,
#worksScreen[data-works-view="album"] .work-card-media-open > span {
  display: none;
}

#worksScreen[data-works-view="album"] .work-text-preview {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  padding: 14px;
  font-size: 11px;
}

#worksScreen[data-works-view="album"] .work-text-preview > img {
  display: none;
}

@media (max-width: 280px) {
  #worksScreen[data-works-view="album"] .work-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* v234 · app-owned, cross-device browser shell for the Chinese image inspiration library */
.has-inspiration-browser-open,
.has-inspiration-browser-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.inspiration-browser-shell {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  width: 100dvw;
  max-width: none;
  height: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  height: var(--inspiration-vvh, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
  background: #090c14;
  color: #3d2a21;
  isolation: isolate;
}

.inspiration-browser-shell[hidden] {
  display: none !important;
}

.inspiration-browser-bar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  min-height: calc(72px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top, 0px))
    max(12px, env(safe-area-inset-right, 0px))
    8px
    max(12px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(103, 72, 50, 0.14);
  background: #fff9f2;
  box-shadow: 0 8px 24px rgba(33, 22, 16, 0.14);
}

.inspiration-browser-action {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #ead8c7;
  border-radius: 15px;
  background: #fff;
  color: #4b3328;
  box-shadow: 0 5px 14px rgba(77, 46, 29, 0.08);
}

.inspiration-browser-action:active {
  transform: scale(0.96);
  background: #fff1df;
}

.inspiration-browser-action:focus-visible {
  outline: 3px solid rgba(255, 169, 31, 0.38);
  outline-offset: 2px;
}

.inspiration-browser-action svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inspiration-browser-heading {
  min-width: 0;
  max-width: 560px;
  justify-self: center;
  text-align: center;
}

.inspiration-browser-heading span,
.inspiration-browser-heading small,
.inspiration-browser-heading strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspiration-browser-heading span {
  color: #a66a26;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.inspiration-browser-heading strong {
  margin-top: 2px;
  color: #35231c;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.15;
}

.inspiration-browser-heading small {
  margin-top: 2px;
  color: #8c766a;
  font-size: 10px;
  line-height: 1.1;
}

.inspiration-browser-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: 0
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  overflow: hidden;
  overscroll-behavior: contain;
  background: #090c14;
}

.inspiration-browser-viewport iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: #090c14;
}

.inspiration-browser-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  background: radial-gradient(circle at 50% 38%, #fff4d2 0, #fff9f2 42%, #f9efe7 100%);
  text-align: center;
}

.inspiration-browser-loading[hidden] {
  display: none !important;
}

.inspiration-browser-loading img {
  width: 58px;
  height: 58px;
  padding: 10px;
  border: 1px solid rgba(222, 146, 39, 0.26);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(148, 91, 28, 0.14);
  animation: inspiration-browser-pulse 1.25s ease-in-out infinite;
}

.inspiration-browser-loading strong {
  margin-top: 5px;
  color: #3b281f;
  font-size: 17px;
  font-weight: 850;
}

.inspiration-browser-loading small {
  color: #8a7164;
  font-size: 12px;
}

@keyframes inspiration-browser-pulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.035); }
}

@media (prefers-reduced-motion: reduce) {
  .inspiration-browser-loading img {
    animation: none;
  }

  .inspiration-browser-action:active {
    transform: none;
  }
}

@media (max-width: 340px) {
  .inspiration-browser-bar {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 5px;
    padding-right: max(8px, env(safe-area-inset-right, 0px));
    padding-left: max(8px, env(safe-area-inset-left, 0px));
  }

  .inspiration-browser-action {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .inspiration-browser-heading strong {
    font-size: 15px;
  }

  .inspiration-browser-heading small {
    font-size: 9px;
  }
}

@media (orientation: landscape) and (max-height: 480px) {
  .inspiration-browser-bar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    min-height: calc(56px + env(safe-area-inset-top, 0px));
    padding-top: calc(4px + env(safe-area-inset-top, 0px));
    padding-bottom: 4px;
  }

  .inspiration-browser-heading span,
  .inspiration-browser-heading small {
    display: none;
  }

  .inspiration-browser-heading strong {
    margin-top: 0;
    font-size: 15px;
  }

  .inspiration-browser-loading {
    gap: 5px;
    padding: 16px;
  }

  .inspiration-browser-loading img {
    width: 46px;
    height: 46px;
    padding: 8px;
    border-radius: 16px;
  }

  .inspiration-browser-loading strong {
    margin-top: 0;
    font-size: 15px;
  }
}

/* v238: Seedance 2.0 model access and advanced-membership affordances. */
.creator-settings-fields label > small {
  color: #8b7462;
  font-size: 10.5px;
  line-height: 1.4;
}

#creatorVideoModelField[data-requires-membership="advanced"] {
  background: linear-gradient(145deg, #fff8df, #fff2d4);
  border-color: rgba(195, 137, 31, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

#creatorVideoModelField[data-requires-membership="advanced"] > span,
#creatorVideoModelField[data-requires-membership="advanced"] > small {
  color: #7c5012;
}

#templatesScreen [data-requires-membership="advanced"],
.template-detail-actions [data-requires-membership="advanced"],
.template-seedance-segment-actions [data-requires-membership="advanced"] {
  color: #5c3904;
  background: linear-gradient(135deg, #ffe08a, #f4b83f);
  border-color: rgba(178, 113, 8, 0.42);
  box-shadow: 0 8px 18px rgba(177, 111, 10, 0.16);
}

#templatesScreen [data-requires-membership="advanced"]::after,
.template-detail-actions [data-requires-membership="advanced"]::after,
.template-seedance-segment-actions [data-requires-membership="advanced"]::after {
  content: "高级";
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  color: #fff9e8;
  background: #8a5608;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  vertical-align: 1px;
}
