/*
 * Pet Mobile System Layer v136
 * A small, deliberate migration layer over the historical stylesheet.
 * New product work should use these tokens and components instead of adding
 * another versioned override block to pet-mobile.css.
 */

:root {
  --color-bg: #fff9f2;
  --color-surface: #ffffff;
  --color-surface-soft: #fff2dc;
  --color-text: #30241c;
  --color-text-muted: #6f6259;
  --color-text-subtle: #7a6d64;
  --color-border: #e8ded4;
  --color-brand: #f6b73c;
  --color-on-brand: #3a250f;
  --color-brand-strong: #a94808;
  --color-success: #26724f;
  --color-danger: #aa3434;
  --font-ui: system-ui, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", sans-serif;
  --text-caption: 12px;
  --text-caption-readable: 12.5px;
  --text-body: 14px;
  --text-body-readable: 15px;
  --text-body-strong: 16px;
  --text-title: 20px;
  --text-page-title: 24px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-control: 10px;
  --radius-card: 16px;
  --radius-hero: 28px;
  --radius-sheet: 24px;
  --radius-dock: 24px;
  --radius-pill: 999px;
  --surface-shadow-card: 0 4px 16px rgba(59, 40, 24, 0.08);
  --shadow-card: var(--surface-shadow-card);
  --shadow-dock: 0 -8px 28px rgba(59, 40, 24, 0.12);
  --shadow-overlay: 0 -20px 60px rgba(36, 25, 17, 0.24);
  --motion-fast: 120ms;
  --motion-standard: 220ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tap-min: 44px;
  --page-gutter: 16px;
  --app-shell-max-width: 430px;
}

html {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

body {
  color: var(--color-text);
  background: var(--color-bg);
}

.phone-app {
  color: var(--color-text);
  background: var(--color-bg);
}

.phone-app button,
.phone-app [role="button"],
.phone-app input,
.phone-app select,
.phone-app textarea {
  font-size: var(--text-body);
}

.phone-app button:not([hidden]) {
  min-height: var(--tap-min);
  touch-action: manipulation;
}

.phone-app[data-active-screen] > .app-screen.is-active button:not([hidden]),
.phone-app[data-active-screen] > .app-screen.is-active a[href],
.phone-app dialog button:not([hidden]) {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
}

.phone-app :where(button, input, select, textarea, summary, a):focus-visible {
  outline: 3px solid rgba(169, 72, 8, 0.36);
  outline-offset: 2px;
}

.phone-app :where(p, li) {
  text-wrap: pretty;
}

.phone-app :where(h1, h2, h3, strong) {
  text-wrap: balance;
}

.screen-content,
.home-content,
.profile-page-content,
.works-page-content,
.assistant-content,
.inspiration-page-content {
  padding-right: var(--page-gutter);
  padding-left: var(--page-gutter);
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.phone-app[data-active-screen="home"] #homeScreen .home-content,
.phone-app[data-active-screen="templates"] #templatesScreen .screen-content,
.phone-app[data-active-screen="works"] #worksScreen .works-page-content,
.phone-app[data-active-screen="profile"] #profileScreen .profile-page-content {
  padding-bottom: calc(124px + env(safe-area-inset-bottom));
}

/* Shared navigation */

.bottom-nav {
  min-height: calc(72px + env(safe-area-inset-bottom));
  padding: 7px 9px max(7px, env(safe-area-inset-bottom));
  background: rgba(255, 253, 249, 0.92);
  border-top: 1px solid rgba(216, 196, 176, 0.72);
  box-shadow: 0 -10px 32px rgba(72, 46, 25, 0.11);
  backdrop-filter: blur(20px) saturate(1.2);
}

.bottom-nav > button {
  position: relative;
  min-width: var(--tap-min);
  min-height: 56px;
  gap: 3px;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  box-shadow: none;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  transition:
    color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}

.bottom-nav > button span,
.bottom-nav > button strong {
  font-size: var(--text-caption);
  line-height: 1.2;
  font-weight: var(--weight-medium);
}

.bottom-nav > button.is-active {
  color: var(--color-brand-strong);
  background: linear-gradient(180deg, rgba(255, 240, 205, 0.82), rgba(255, 249, 238, 0.42));
  border-color: rgba(230, 177, 92, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.bottom-nav .assistant-nav-button,
.bottom-nav .assistant-nav-button.is-active {
  min-width: 58px;
  transform: none;
}

.bottom-nav .assistant-nav-button img {
  width: 48px;
  height: 48px;
  opacity: 0.88;
  filter: saturate(0.72);
  border: 2px solid rgba(232, 222, 212, 0.96);
  box-shadow: 0 4px 12px rgba(85, 54, 25, 0.12);
  transition:
    transform var(--motion-standard) var(--ease-out),
    box-shadow var(--motion-standard) var(--ease-out),
    filter var(--motion-standard) var(--ease-out),
    opacity var(--motion-standard) var(--ease-out);
}

.bottom-nav .assistant-nav-button.is-active img {
  width: 50px;
  height: 50px;
  opacity: 1;
  filter: none;
  border-width: 3px;
  border-color: #ffd77d;
  box-shadow:
    0 8px 20px rgba(85, 54, 25, 0.2),
    0 0 0 4px rgba(255, 210, 112, 0.18);
  transform: translateY(-2px);
}

/* v248: a readable video-template glyph that keeps its shape in every nav state. */
.bottom-nav .bottom-nav-template-icon {
  display: block;
  width: 23px;
  height: 23px;
  overflow: visible;
  color: currentColor;
  opacity: 0.78;
  transition:
    color var(--motion-fast) var(--ease-out),
    opacity var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}

.bottom-nav > button.is-active .bottom-nav-template-icon,
.phone-app[data-active-screen="templates"] .bottom-nav [data-open-screen="templates"] .bottom-nav-template-icon {
  opacity: 1;
  transform: translateY(-1px);
}

/* Home */

.home-hero,
.home-page-content {
  padding-right: var(--page-gutter);
  padding-left: var(--page-gutter);
}

.home-brand-title strong {
  font-size: 22px;
  font-weight: var(--weight-bold);
}

.home-brand-lockup p,
.home-section-head p,
.home-hero p {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.home-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 8px 6px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 207, 186, 0.74);
  border-radius: 24px;
  box-shadow: 0 10px 26px rgba(76, 50, 28, 0.075);
}

.home-action-grid::-webkit-scrollbar,
.assistant-feature-scroll::-webkit-scrollbar,
.template-page-tabs::-webkit-scrollbar {
  display: none;
}

.home-action-grid > button,
.home-action-grid > a {
  position: relative;
  display: grid;
  grid-template-rows: 38px auto;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 76px;
  padding: 5px 2px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  transition:
    transform var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}

.home-action-grid > a {
  color: inherit;
  text-decoration: none;
}

.home-action-grid > * + *::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 1px;
  background: rgba(232, 217, 200, 0.72);
  content: "";
  pointer-events: none;
}

.home-action-grid .home-action-art {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.home-action-grid strong,
.home-action-grid span {
  font-size: 11px;
  line-height: 1.2;
}

.home-action-grid small {
  display: none;
}

.home-recent-grid,
#homeRecentWorks {
  display: grid;
  grid-auto-columns: minmax(108px, 31%);
  grid-auto-flow: column;
  grid-template-columns: none;
  gap: var(--space-3);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}

.home-recent-card,
.home-recent-create {
  min-height: 122px;
  scroll-snap-align: start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  overflow: hidden;
}

.home-recent-card > img {
  width: 100%;
  height: 82px;
  object-fit: cover;
}

.home-recent-card > span:last-child,
.home-recent-create span {
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.home-recent-type {
  display: grid;
  place-items: center;
  min-height: 66px;
  color: var(--color-brand-strong);
  background: var(--color-surface-soft);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

.home-recent-empty {
  width: calc(100vw - (var(--page-gutter) * 2));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: var(--space-3);
  min-height: 84px;
  padding: 11px 12px 11px 14px;
  border: 1px dashed #d7c7b7;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.72);
}

.home-recent-empty strong {
  font-size: var(--text-body-strong);
}

.home-recent-empty span {
  grid-column: 1;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  line-height: 1.4;
}

.home-recent-empty button {
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  color: var(--color-on-brand);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-brand);
  font-weight: var(--weight-semibold);
}

.home-agent-live {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

.home-agent-live i {
  display: none;
}

/* Inspiration */

.inspiration-page-header,
.works-page-header,
.profile-page-header,
.screen-header.creator-header {
  padding-right: var(--page-gutter);
  padding-left: var(--page-gutter);
}

.template-page-tabs,
.inspiration-hot-tags {
  min-height: var(--tap-min);
  gap: var(--space-2);
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.template-page-tabs button,
.inspiration-hot-tags button,
.inspiration-query-row button,
.inspiration-category-grid button {
  min-height: var(--tap-min);
  padding: 0 14px;
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.inspiration-trend-status,
.template-source-note,
.inspiration-source-note {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  line-height: 1.55;
}

.template-card h3,
.template-library-card h3 {
  font-size: var(--text-body-strong);
}

.template-card p,
.template-library-card p {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Works: user content comes first */

.works-page-heading h1 {
  margin: 0;
  font-size: var(--text-page-title);
  font-weight: var(--weight-bold);
}

.works-page-heading p {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: var(--text-body);
}

.works-page-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.works-personal-section {
  order: -1;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.works-personal-section > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: var(--tap-min);
  margin-bottom: var(--space-3);
}

.works-personal-section > header span {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  text-transform: none;
}

.works-personal-section > header h2 {
  margin: 2px 0 0;
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
}

.works-personal-section > header button {
  min-width: var(--tap-min);
  padding: 0 12px;
  color: var(--color-danger);
  border: 0;
  background: transparent;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

.work-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

#worksScreen .work-list > .work-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

#worksScreen .work-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  align-items: start;
  padding: 0;
}

.work-title-block {
  min-width: 0;
}

.work-title-block > strong {
  display: block;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--text-body-strong);
  line-height: 1.35;
  font-weight: var(--weight-bold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-title-block .work-meta {
  margin: 5px 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  line-height: 1.35;
}

.work-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: #fbf8f5;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

.work-card-open {
  display: grid;
  place-items: center;
  width: var(--tap-min);
  min-width: var(--tap-min);
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
}

.work-card-open img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

#worksScreen .work-card-preview {
  height: auto;
  margin: 0;
  padding: 0;
}

#worksScreen .work-text-preview {
  display: block;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

#worksScreen .work-text-preview > div {
  width: 100%;
  display: grid;
  gap: 6px;
}

#worksScreen .work-text-preview span {
  color: var(--color-brand-strong);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

#worksScreen .work-text-preview p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--text-body);
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.work-card .work-media {
  width: 100%;
  max-height: 220px;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f1ece7;
}

.work-card .work-media img,
.work-card .work-media video {
  width: 100%;
  height: 100%;
  min-height: 164px;
  object-fit: cover;
}

#worksScreen .work-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  padding: 0;
  border: 0;
}

#worksScreen .work-card-actions button {
  min-height: var(--tap-min);
  padding: 0 16px;
  border-radius: var(--radius-control);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
}

#worksScreen .work-card-actions .primary {
  color: var(--color-on-brand);
  border: 1px solid var(--color-brand);
  background: var(--color-brand);
}

#worksScreen .work-card-actions .secondary {
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.works-feature-shell,
.works-category-filter,
.works-showcase-grid {
  margin-top: 0;
}

.works-category-filter {
  gap: var(--space-2);
}

.works-category-filter button,
.works-feature-dots button,
.works-showcase-card button {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
}

#worksDiscoverySurface::before {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--color-text);
  content: "发现灵感";
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
  margin-right: var(--page-gutter);
  margin-left: var(--page-gutter);
}

/* Assistant: conversational hierarchy */

.assistant-hero {
  min-height: 0;
  padding: 10px var(--page-gutter) 0;
}

.assistant-header-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.assistant-new-chat {
  padding: 0 12px;
  color: var(--color-brand-strong);
  border: 1px solid #f0d6a6;
  border-radius: var(--radius-pill);
  background: #fff8e9;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

.assistant-showcase {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 118px;
  padding: var(--space-3);
  border: 1px solid rgba(232, 222, 212, 0.8);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #fff4df, #fffdfa);
  box-shadow: none;
  overflow: hidden;
}

.assistant-showcase-robot {
  position: static;
  width: 96px;
  height: 92px;
  object-fit: contain;
  transform: none;
}

.assistant-showcase-copy {
  position: static;
  align-self: center;
  padding: 0;
}

.assistant-showcase-copy > span {
  color: var(--color-brand-strong);
  font-size: var(--text-caption);
  letter-spacing: 0;
}

.assistant-showcase-copy h1 {
  margin: 3px 0;
  color: var(--color-text);
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
}

.assistant-showcase-copy p {
  max-width: none;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.has-assistant-reply .assistant-showcase {
  min-height: 72px;
  grid-template-columns: 54px minmax(0, 1fr);
  padding: 8px 12px;
}

.has-assistant-reply .assistant-showcase-robot {
  width: 54px;
  height: 54px;
}

.has-assistant-reply .assistant-showcase-copy p,
.has-assistant-reply .assistant-showcase-copy > span {
  display: none;
}

.has-assistant-reply .assistant-showcase-copy h1 {
  margin: 0;
  font-size: var(--text-body-strong);
}

.assistant-content {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-height: 0;
  padding-top: var(--space-3);
  padding-bottom: calc(196px + env(safe-area-inset-bottom));
}

.assistant-starter-prompt {
  display: flex;
  width: auto;
  min-height: var(--tap-min);
  margin: 0;
  padding: 9px 12px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: var(--color-surface);
  box-shadow: none;
  text-align: left;
}

.assistant-starter-prompt img {
  display: none;
}

.assistant-starter-copy {
  display: grid;
  gap: 2px;
}

.assistant-starter-copy small {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

.assistant-starter-copy strong {
  font-size: 13px;
  line-height: 1.4;
  font-weight: var(--weight-semibold);
}

.assistant-welcome-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 8px var(--radius-card) var(--radius-card) var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.assistant-welcome-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.assistant-welcome-card strong {
  font-size: var(--text-body);
  line-height: 1.45;
}

.assistant-welcome-card p,
.assistant-welcome-card span {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.sent-message-card {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--space-2);
  margin: 0 0 0 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sent-message-card > div {
  padding: 11px 14px;
  border-radius: var(--radius-card) 8px var(--radius-card) var(--radius-card);
  background: #ffe7ad;
}

.sent-message-card strong {
  display: none;
}

.sent-message-card p {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-body);
  line-height: 1.58;
}

.sent-message-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid #f2d49a;
  border-radius: 50%;
  object-fit: cover;
}

.reply-card {
  display: grid;
  gap: 0;
  margin: 0 32px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px var(--radius-card) var(--radius-card) var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.reply-head {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 9px 12px 4px;
}

.reply-head > img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.assistant-speaker-line strong {
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
}

.assistant-speaker-line span {
  color: var(--color-success);
  font-size: var(--text-caption);
}

.assistant-speaker > p {
  display: none;
}

.prompt-card {
  margin: 0;
  padding: 4px 14px 14px 56px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.prompt-card-head {
  min-height: var(--tap-min);
  margin: 0 0 4px;
}

.prompt-card-head h2 {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

.prompt-card-head h2 img {
  display: none;
}

.prompt-card-head button {
  min-height: var(--tap-min);
  padding: 0 8px;
  color: var(--color-text-muted);
  border: 0;
  background: transparent;
  font-size: var(--text-caption);
}

.assistant-markdown,
.assistant-markdown p,
.assistant-markdown li {
  color: var(--color-text);
  font-size: var(--text-body);
  line-height: 1.68;
}

.assistant-markdown h2,
.assistant-markdown h3 {
  margin: 18px 0 8px;
  font-size: var(--text-body-strong);
  line-height: 1.4;
  font-weight: var(--weight-bold);
}

.assistant-markdown .assistant-plan-details,
.assistant-markdown .assistant-next-question {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fffcf7;
  box-shadow: none;
}

.assistant-markdown .assistant-next-question {
  padding: 10px 0 0;
  color: var(--color-text-muted);
  border: 0;
  background: transparent;
}

.agent-status {
  min-height: 0;
  margin: 0;
  padding: 0 14px 10px 56px;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

.agent-status:empty,
.agent-status[data-state="done"] {
  display: none;
}

.agent-mode-switch {
  display: none;
}

.agent-cancel-button {
  justify-self: start;
  min-height: var(--tap-min);
  margin: 0 0 12px 56px;
  padding: 0 14px;
  color: var(--color-danger);
  border: 1px solid #e6b8b8;
  border-radius: var(--radius-control);
  background: #fff7f7;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

#assistantScreen .assistant-content > .action-grid {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0 32px 0 0;
}

.has-assistant-reply:not(.is-agent-busy) #assistantScreen .assistant-content > .action-grid {
  display: grid;
}

.action-grid button {
  min-width: 0;
  min-height: var(--tap-min);
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: none;
}

.action-grid button img {
  width: 18px;
  height: 18px;
}

.action-grid button span {
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

.has-assistant-reply .assistant-starter-prompt,
.has-assistant-reply .assistant-welcome-card,
.has-assistant-reply .quick-block,
.has-assistant-reply .assistant-inspiration-panel {
  display: none;
}

.assistant-block.quick-block {
  margin: 0;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: none;
}

.quick-block h2 {
  font-size: var(--text-body);
}

.quick-pills button,
.style-pills button {
  min-height: var(--tap-min);
  padding: 0 14px;
  font-size: 13px;
}

.assistant-composer-dock {
  bottom: calc(72px + env(safe-area-inset-bottom));
  padding: 8px var(--page-gutter) 10px;
  border-top: 1px solid var(--color-border);
  background: rgba(255, 252, 247, 0.97);
  box-shadow: var(--shadow-dock);
  backdrop-filter: blur(18px);
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: none;
}

.composer > textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  max-height: 112px;
  margin: 0;
  padding: 9px 10px;
  resize: none;
  overflow-y: auto;
  color: var(--color-text);
  border: 0;
  border-radius: var(--radius-control);
  background: #fbf8f5;
  font-size: var(--text-body);
  line-height: 1.5;
  field-sizing: content;
}

.composer > textarea::placeholder,
.creator-panel textarea::placeholder,
.profile-settings-panel input::placeholder,
.template-search input::placeholder {
  color: var(--color-text-subtle);
  opacity: 1;
}

.composer-tools-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--tap-min);
  gap: var(--space-2);
  align-items: center;
}

.assistant-feature-toolbar,
.assistant-feature-scroll {
  min-width: 0;
}

.assistant-feature-scroll {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.assistant-feature-scroll button,
.send-button {
  flex: 0 0 auto;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0 10px;
  border-radius: var(--radius-control);
}

#assistantScreen .assistant-feature-scroll > button:not(.assistant-add-reference) {
  display: inline-flex;
  flex: 0 0 50px;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  width: 50px;
  min-width: 50px;
  min-height: var(--tap-min);
  height: var(--tap-min);
  padding: 2px;
}

#assistantScreen .assistant-feature-scroll > [data-assistant-shortcut="quick"] {
  flex-basis: 54px;
  width: 54px;
  min-width: 54px;
}

.phone-app #assistantScreen .assistant-feature-scroll > .assistant-add-reference {
  flex: 0 0 var(--tap-min);
  width: var(--tap-min);
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  height: var(--tap-min);
}

#assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="ppt"],
#assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="writing"] {
  display: none;
}

.assistant-feature-scroll button {
  color: var(--color-text-muted);
  border: 1px solid transparent;
  background: transparent;
}

.assistant-feature-scroll button.is-active {
  color: var(--color-brand-strong);
  border-color: #f1d08e;
  background: var(--color-surface-soft);
}

.assistant-feature-scroll button img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.assistant-feature-scroll button span {
  font-size: 11.5px;
  line-height: 1.15;
}

.assistant-feature-divider {
  display: none;
}

.send-button {
  display: grid;
  place-items: center;
  width: var(--tap-min);
  padding: 0;
  color: var(--color-on-brand);
  border: 0;
  background: var(--color-brand);
}

/* Creator screens */

.creator-content {
  display: grid;
  gap: var(--space-4);
}

.creator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  min-height: 152px;
  padding: var(--space-4);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.creator-hero h2 {
  max-width: 210px;
  margin: 5px 0 8px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: var(--weight-bold);
}

.creator-hero p {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.creator-hero > img {
  align-self: end;
  justify-self: end;
  width: 96px;
  height: 112px;
  object-fit: contain;
}

.creator-panel {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.creator-panel > label {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
}

.creator-panel textarea {
  min-height: 128px;
  padding: 12px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fffcf8;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
}

.creator-settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--tap-min);
  padding: 0 12px;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fbf8f5;
  font-size: 13px;
  text-align: left;
}

.creator-settings-summary span {
  color: var(--color-brand-strong);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

.creator-preset-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.creator-preset-row button {
  flex: 0 0 auto;
  min-height: var(--tap-min);
  padding: 0 14px;
  font-size: 13px;
}

.creator-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
}

.creator-actions button {
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
}

/* Profile */

.profile-page-content {
  gap: var(--space-4);
}

.profile-identity-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.profile-membership-card,
.profile-menu-card,
.profile-subpanel {
  border: 1px solid rgba(232, 222, 212, 0.78);
  border-radius: var(--radius-card);
  box-shadow: none;
}

.profile-identity-copy h1 {
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
}

.profile-identity-copy p,
.profile-membership-card p {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.profile-stat-grid button,
.profile-menu-card button,
.profile-membership-card button,
.profile-panel-head button,
.profile-actions button,
.profile-avatar-setting button,
.profile-history-item button {
  min-height: var(--tap-min);
}

.profile-stat-grid span,
.profile-menu-card strong,
.profile-membership-card strong,
.profile-panel-head strong,
.profile-avatar-setting strong {
  font-size: var(--text-body);
}

.profile-settings-panel {
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
}

.profile-settings-panel > label {
  display: grid;
  gap: 7px;
  padding: 12px 0;
}

.profile-settings-panel > label > span {
  color: var(--color-text);
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.profile-settings-panel input,
.profile-settings-panel select {
  min-height: var(--tap-min);
  padding: 0 12px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.profile-advanced-setting > span small {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 5px;
  padding: 0 7px;
  color: var(--color-text-muted);
  border-radius: var(--radius-pill);
  background: #f3eee8;
  font-size: 11px;
  font-weight: var(--weight-medium);
}

.profile-advanced-setting > small {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.profile-settings-status {
  color: var(--color-success);
  font-size: var(--text-caption);
}

.phone-app #profileScreen .profile-page-content {
  display: flex;
  flex-direction: column;
}

#profileScreen .profile-identity-card {
  order: 0;
}

#profileScreen .profile-menu-card {
  order: 2;
}

#profileScreen .profile-membership-card {
  order: 1;
}

#profileScreen .profile-subpanel {
  order: 3;
}

#profileScreen .profile-identity-card.is-unset .profile-identity-art {
  display: block;
  opacity: 0.18;
  object-position: 86% center;
}

#profileScreen .profile-identity-card.is-unset .profile-identity-copy {
  padding-right: var(--space-4);
}

/* Results and recovery */

.generation-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.generation-head h2,
.generation-progress-card strong,
.generation-unavailable-card strong {
  font-size: var(--text-body-strong);
}

.generation-head span,
.generation-head > strong,
.generation-progress-card > div > span,
.generation-task-note {
  font-size: var(--text-caption);
}

.generation-progress-card p,
.generation-unavailable-card p {
  color: var(--color-text-muted);
  font-size: var(--text-body);
  line-height: 1.55;
}

.generation-unavailable-card {
  display: grid;
  gap: var(--space-3);
}

.generation-recovery-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.generation-recovery-actions button {
  min-height: var(--tap-min);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  font-weight: var(--weight-semibold);
}

.generation-recovery-actions .primary {
  color: var(--color-on-brand);
  border-color: var(--color-brand);
  background: var(--color-brand);
}

.generation-unavailable-card details {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

.generation-unavailable-card summary {
  min-height: var(--tap-min);
  padding: 12px 0;
  cursor: pointer;
}

.generation-panel[data-result-mode="error"] .generation-actions {
  display: none;
}

.assistant-result-gallery {
  display: block;
}

.assistant-result-gallery img {
  width: 100%;
  max-height: 520px;
  border-radius: 12px;
  object-fit: contain;
}

.assistant-result-note {
  color: var(--color-success);
  font-size: var(--text-caption);
}

/* Work detail sheet */

.work-detail-shell {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  align-items: end;
}

.work-detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(42, 30, 20, 0.38);
}

.work-detail-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: min(100%, 560px);
  max-height: min(88dvh, 820px);
  margin: 0 auto;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: var(--color-surface);
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
}

.work-detail-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.work-detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  padding: 8px var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.98);
}

.work-detail-head span,
.work-detail-head p {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

.work-detail-head h2 {
  margin: 3px 0;
  font-size: var(--text-title);
  line-height: 1.35;
}

.work-detail-head > button {
  min-width: var(--tap-min);
  padding: 0 8px;
  color: var(--color-text-muted);
  border: 0;
  background: transparent;
}

.work-detail-preview {
  max-height: 240px;
  padding: var(--space-3) var(--space-4) 0;
  overflow: hidden;
}

.work-detail-source {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  margin-top: var(--space-2);
  color: var(--color-brand-strong);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.work-detail-body {
  min-height: 0;
  padding: var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.work-detail-markdown,
.work-detail-markdown p,
.work-detail-markdown li {
  font-size: 15px;
  line-height: 1.72;
}

.work-detail-intro + .work-detail-section {
  margin-top: var(--space-3);
}

.work-detail-section {
  border-top: 1px solid var(--color-border);
}

.work-detail-section summary {
  min-height: 52px;
  padding: 14px 28px 12px 0;
  cursor: pointer;
  font-size: var(--text-body-strong);
  font-weight: var(--weight-bold);
}

.work-detail-section > div {
  padding: 0 0 var(--space-4);
}

.work-detail-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  padding: 10px var(--space-4) max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.98);
}

.work-detail-actions button {
  min-height: var(--tap-min);
  padding: 0 12px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.work-detail-actions .primary {
  color: var(--color-on-brand);
  border: 1px solid var(--color-brand);
  background: var(--color-brand);
}

.work-detail-actions .secondary {
  color: var(--color-text);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.work-detail-actions .tertiary,
.work-detail-actions button:not(.primary):not(.secondary) {
  min-width: var(--tap-min);
  padding: 0 8px;
  color: var(--color-text-muted);
  border: 0;
  background: transparent;
}

/* Global feedback */

.app-toast {
  position: fixed;
  z-index: 400;
  right: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(calc(100% - 32px), 430px);
  padding: 11px 15px;
  color: #fff;
  border-radius: var(--radius-control);
  background: #3a3029;
  box-shadow: 0 10px 30px rgba(41, 29, 20, 0.24);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: translate(50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

.app-toast[data-tone="error"] {
  background: var(--color-danger);
}

.app-toast[data-tone="done"] {
  background: #285f47;
}

@media (max-width: 360px) {
  :root {
    --page-gutter: 14px;
  }

  .creator-hero {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .creator-hero > img {
    width: 82px;
  }

  .assistant-showcase {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .assistant-showcase-robot {
    width: 78px;
  }

  .work-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-detail-actions .tertiary,
  .work-detail-actions button:not(.primary):not(.secondary) {
    min-width: 0;
    border: 1px solid var(--color-border);
  }

  .assistant-back-home span {
    display: none;
  }

  .assistant-back-home {
    width: var(--tap-min);
    min-width: var(--tap-min);
    padding: 0;
  }
}

.destructive-confirm-dialog {
  width: min(340px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 70px rgba(76, 45, 22, 0.24);
}

.destructive-confirm-dialog::backdrop {
  background: rgba(38, 27, 19, 0.48);
  backdrop-filter: blur(3px);
}

.destructive-confirm-dialog form {
  display: grid;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.destructive-confirm-dialog form > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  background: #fff0eb;
  color: #c54125;
  font-size: 22px;
  font-weight: 800;
}

.destructive-confirm-dialog h2,
.destructive-confirm-dialog p {
  margin: 0;
}

.destructive-confirm-dialog h2 {
  font-size: 19px;
  line-height: 1.35;
}

.destructive-confirm-dialog p {
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.destructive-confirm-dialog form > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.destructive-confirm-dialog button {
  min-height: var(--tap-min);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--color-text);
  font: inherit;
  font-weight: 700;
}

.destructive-confirm-dialog button.danger {
  border-color: #c54125;
  background: #c54125;
  color: #fff;
}

/* Touch and readability locks for legacy ID-scoped inspiration/profile rules. */

.phone-app[data-active-screen="templates"] #templatesScreen #templateSearchClear {
  width: var(--tap-min);
  min-width: var(--tap-min);
  height: var(--tap-min);
  min-height: var(--tap-min);
}

.phone-app[data-active-screen="templates"] #templatesScreen .inspiration-section-head > #inspirationMoreTags,
.phone-app[data-active-screen="templates"] #templatesScreen .inspiration-section-head > #templateShowAllBtn,
.phone-app[data-active-screen="templates"] #templatesScreen .template-page-tabs > button {
  min-height: var(--tap-min);
  font-size: 13px;
}

.phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid small,
.phone-app[data-active-screen="templates"] #templatesScreen .template-result-summary,
.phone-app[data-active-screen="templates"] #templatesScreen .template-trend-badge {
  font-size: 12px;
  line-height: 1.5;
}

.phone-app[data-active-screen="templates"] #templatesScreen .template-trend-badge {
  max-width: calc(100% - 16px);
}

.phone-app[data-active-screen="templates"] #templatesScreen .template-library-card:has(.template-favorite-button) .template-trend-badge {
  max-width: calc(100% - 56px);
}

.phone-app[data-active-screen="templates"] #templatesScreen .inspiration-topbar .home-alert-button,
.phone-app[data-active-screen="templates"] #templatesScreen .inspiration-topbar .home-avatar-button,
.phone-app[data-active-screen="templates"] #templatesScreen .template-library-actions > button {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  height: auto;
}

.phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid > button {
  grid-template-columns: 46px minmax(0, 1fr) 20px;
  min-height: 88px;
}

.phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid small {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.phone-app[data-active-screen="profile"] #profileScreen .home-header-actions > .home-alert-button,
.phone-app[data-active-screen="profile"] #profileScreen .home-header-actions > .home-avatar-button {
  width: var(--tap-min);
  min-width: var(--tap-min);
  height: var(--tap-min);
  min-height: var(--tap-min);
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-membership-card > #profileMembershipBtn {
  min-height: var(--tap-min);
}

.phone-app[data-active-screen="home"] #homeScreen .home-action-grid small,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-starter-copy small,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-welcome-card p,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-welcome-card span,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-speaker p,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-speaker span,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll button span,
.phone-app[data-active-screen="profile"] #profileScreen .profile-stat-grid span,
.phone-app[data-active-screen="profile"] #profileScreen .profile-membership-card p,
.phone-app[data-active-screen="profile"] #profileScreen .profile-membership-card > button,
.phone-app[data-active-screen="works"] #worksScreen .works-category-filter button,
.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite span {
  font-size: 12px;
  line-height: 1.4;
}

.phone-app[data-active-screen="assistant"] #assistantScreen #promptInput {
  min-height: var(--tap-min);
  font-size: 15px;
  line-height: 1.45;
}

.phone-app[data-active-screen="assistant"] #assistantScreen #copyPromptBtn {
  min-height: var(--tap-min);
  padding-inline: 14px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > #assistantAddReferenceBtn,
.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row > .send-button {
  width: var(--tap-min);
  min-width: var(--tap-min);
  height: var(--tap-min);
  min-height: var(--tap-min);
}

@media (max-width: 360px) {
  .phone-app[data-active-screen="profile"] #profileScreen .profile-membership-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .phone-app[data-active-screen="profile"] #profileScreen .profile-membership-card > #profileMembershipBtn {
    grid-column: 2;
    width: 100%;
    margin-top: 2px;
  }

  .phone-app[data-active-screen="profile"] #profileScreen .profile-membership-card p {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  .phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid > button {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    padding-inline: 10px;
  }

  .phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid > button > img {
    width: 42px;
    height: 42px;
  }

  .phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid .inspiration-action-arrow {
    display: none;
  }

  .phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid strong,
  .phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid small {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  .phone-app[data-active-screen="templates"] #templatesScreen .template-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.phone-app[data-active-screen="home"] #homeScreen .home-brand-lockup p,
.phone-app[data-active-screen="home"] #homeScreen .case-strip strong,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup p,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy span,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy p,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-preview-note,
.phone-app[data-active-screen="works"] #worksScreen .works-feature-card p,
.phone-app[data-active-screen="works"] #worksScreen .works-showcase-card p,
.phone-app[data-active-screen="profile"] #profileScreen .home-brand-lockup p,
.phone-app[data-active-screen="profile"] #profileScreen .profile-identity-copy p,
.phone-app > .bottom-nav span {
  font-size: 12px;
  line-height: 1.35;
}

.phone-app[data-active-screen="home"] #homeScreen .home-brand-lockup p,
.phone-app[data-active-screen="profile"] #profileScreen .home-brand-lockup p,
.phone-app[data-active-screen="templates"] #templatesScreen .home-brand-lockup p {
  max-width: 180px;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

.phone-app[data-active-screen="home"] #homeScreen .home-action-grid small {
  display: none;
}

.phone-app[data-active-screen="home"] #homeScreen .home-agent-heading > span,
.phone-app[data-active-screen="home"] #homeScreen .home-agent-intro-copy > span,
.phone-app[data-active-screen="home"] #homeScreen .home-agent-intro p,
.phone-app[data-active-screen="home"] #homeScreen .home-agent-filters button,
.phone-app[data-active-screen="home"] #homeScreen .home-agent-live,
.phone-app[data-active-screen="home"] #homeScreen .home-agent-card-copy small,
.phone-app[data-active-screen="home"] #homeScreen .home-agent-card-copy > span,
.phone-app[data-active-screen="home"] #homeScreen .home-agent-card-footer em {
  font-size: 12px;
  line-height: 1.45;
}

.phone-app[data-active-screen="home"] #homeScreen .home-agent-card-copy > span {
  min-height: 36px;
}

.phone-app[data-active-screen="templates"] #templatesScreen .home-brand-lockup p,
.phone-app[data-active-screen="templates"] #templatesScreen .inspiration-action-grid strong,
.phone-app[data-active-screen="templates"] #templatesScreen .template-library-caption strong,
.phone-app[data-active-screen="templates"] #templatesScreen .template-library-actions > button {
  font-size: 12px;
  line-height: 1.35;
}

.phone-app[data-active-screen="image"] #imageScreen .screen-header > div > span,
.phone-app[data-active-screen="image"] #imageScreen .creator-hero > div > span,
.phone-app[data-active-screen="video"] #videoScreen .screen-header > div > span,
.phone-app[data-active-screen="video"] #videoScreen .creator-hero > div > span,
.phone-app[data-active-screen="assistant"] #assistantScreen #copyPromptBtn {
  font-size: 12px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .prompt-card #assistantPrompt {
  font-size: 14px;
  line-height: 1.72;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="ppt"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="writing"] {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button:not(.assistant-add-reference) {
  flex-basis: 48px;
  width: 48px;
  min-width: 48px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"] {
  flex-basis: 52px;
  width: 52px;
  min-width: 52px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content > .action-grid {
  display: none;
}

.phone-app.has-assistant-reply:not(.is-agent-busy)[data-active-screen="assistant"] #assistantScreen .assistant-content > .action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: var(--space-2);
  padding: 0;
}

.phone-app.has-assistant-reply[data-active-screen="assistant"] #assistantScreen .action-grid button {
  width: auto;
  min-width: 0;
  min-height: var(--tap-min);
  padding: 6px 8px;
}

.phone-app.has-assistant-reply[data-active-screen="assistant"] #assistantScreen .action-grid button span {
  white-space: nowrap;
}

/* Strict works-screen accessibility floor over the historical selectors. */

.phone-app[data-active-screen="works"] #worksScreen .works-header-actions button {
  width: var(--tap-min);
  min-width: var(--tap-min);
  height: var(--tap-min);
  min-height: var(--tap-min);
}

.phone-app[data-active-screen="works"] #worksScreen #clearWorksBtn {
  min-height: var(--tap-min);
  padding: 0 12px;
  font-size: var(--text-caption);
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-actions button {
  min-height: var(--tap-min);
  padding: 0 10px;
  font-size: var(--text-caption);
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-actions button span,
.phone-app[data-active-screen="works"] #worksScreen .works-feature-social b,
.phone-app[data-active-screen="works"] #worksScreen .works-feature-copy p,
.phone-app[data-active-screen="works"] #worksScreen .works-feature-badge,
.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite span,
.phone-app[data-active-screen="works"] #worksScreen .works-category-filter button span,
.phone-app[data-active-screen="works"] #worksScreen .works-page-heading p,
.phone-app[data-active-screen="works"] #worksScreen .works-personal-section > header span {
  font-size: var(--text-caption);
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-dots {
  min-height: var(--tap-min);
  height: auto;
  margin: 8px 0;
  align-items: center;
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-dots button {
  position: relative;
  width: var(--tap-min);
  min-width: var(--tap-min);
  height: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-dots button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: #d9d1c8;
  content: "";
  transform: translate(-50%, -50%);
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-dots button.is-active::after {
  width: 22px;
  background: var(--color-brand);
}

.phone-app[data-active-screen="works"] #worksScreen .works-category-filter button,
.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  height: var(--tap-min);
}

@media (prefers-reduced-motion: reduce) {
  .app-toast {
    transition: none;
  }
}

/* High-specificity migration points for legacy assistant rules. */

.phone-app #assistantScreen .assistant-showcase {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 118px;
  padding: var(--space-3);
  border: 1px solid rgba(232, 222, 212, 0.8);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #fff4df, #fffdfa);
  box-shadow: none;
}

.phone-app #assistantScreen .assistant-showcase-robot {
  position: static;
  width: 96px;
  height: 92px;
  object-fit: contain;
  transform: none;
}

.phone-app #assistantScreen .assistant-showcase-copy {
  position: static;
  align-self: center;
  padding: 0;
}

.phone-app.has-assistant-reply #assistantScreen .assistant-showcase {
  grid-template-columns: 54px minmax(0, 1fr);
  min-height: 72px;
  padding: 8px 12px;
}

.phone-app.has-assistant-reply #assistantScreen .assistant-showcase-robot {
  width: 54px;
  height: 54px;
}

.phone-app #assistantScreen .reply-card {
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 8px var(--radius-card) var(--radius-card) var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.phone-app #assistantScreen .reply-card > .reply-head {
  order: 0;
  margin: 0;
  padding: 9px 12px 4px;
}

.phone-app.has-assistant-reply #assistantScreen .reply-card > .reply-head {
  order: 0;
}

.phone-app #assistantScreen .reply-card > .prompt-card {
  order: 1;
  width: auto;
  margin: 0;
  padding: 4px 14px 14px 56px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.phone-app.has-assistant-reply #assistantScreen .reply-card > .prompt-card {
  order: 1;
}

.phone-app #assistantScreen .reply-card > .agent-status {
  display: none;
}

.phone-app #assistantScreen .reply-card > .agent-cancel-button {
  order: 2;
  margin: 0 0 12px 56px;
}

.phone-app #assistantScreen .assistant-content > .action-grid {
  display: none;
}

.phone-app.has-assistant-reply:not(.is-agent-busy) #assistantScreen .assistant-content > .action-grid {
  display: grid;
}

@media (max-width: 360px) {
  .phone-app #assistantScreen .assistant-showcase {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .phone-app #assistantScreen .assistant-showcase-robot {
    width: 78px;
  }
}

/* v140: keep every essential Agent composer action visible at 360px */
@media (max-width: 360px) {
  .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) {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    padding-inline: 3px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"] {
    flex-basis: 52px;
    width: 52px;
    min-width: 52px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    order: 4;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="video"] {
    order: 5;
  }
}

/* v141: strict Agent entry, stable mobile composer and accessible status */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase {
  grid-template-columns: 60px minmax(0, 1fr);
  min-height: 88px;
  height: auto;
  padding: 10px 12px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-robot,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-robot {
  width: 60px;
  height: 60px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy {
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 1px;
  text-align: left;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line {
  flex-wrap: nowrap;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy h1 {
  margin: 1px 0;
  font-size: 18px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.phone-app[data-active-screen="assistant"] #assistantScreen #promptInput {
  font-size: 16px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen #promptInput::placeholder {
  color: #6f6258;
  opacity: 1;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  gap: 8px;
  padding-right: 0;
  overflow: visible;
  scroll-snap-type: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button:not(.assistant-add-reference) {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  min-height: 44px;
  padding-inline: 3px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"] {
  flex-basis: 52px;
  width: 52px;
  min-width: 52px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="video"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="ppt"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="writing"] {
  display: none !important;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"].is-menu-open {
  color: #7b4b1c;
  background: #fff2df;
  border-color: #e5c49d;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-more-menu {
  position: absolute;
  right: 52px;
  bottom: calc(100% + 8px);
  z-index: 62;
  display: grid;
  gap: 4px;
  width: 192px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(225, 202, 173, 0.94);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(86, 57, 29, 0.2);
  backdrop-filter: blur(18px);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-more-menu[hidden] {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-more-menu button {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #4f3b2e;
  background: transparent;
  border: 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-more-menu button:active,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-more-menu button:focus-visible {
  background: #fff2df;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-more-menu img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
  border-radius: 5px;
}

.phone-app #assistantScreen .reply-card > .agent-status {
  display: block !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.phone-app #assistantScreen .reply-card.is-error .ai-content-badge {
  display: none !important;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-auth-submit {
  min-height: 44px;
  font-size: 14px;
}

@media (max-width: 360px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 82px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-robot,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-robot {
    width: 58px;
    height: 58px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    gap: 8px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button:not(.assistant-add-reference) {
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"] {
    flex-basis: 52px;
    width: 52px;
    min-width: 52px;
  }
}

/* v146: restore premium visual hierarchy without restoring unsolicited chat content */
.phone-app[data-active-screen="assistant"] #assistantScreen {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #fff0b8 0, #fff7e5 205px, #fcf9f5 360px, #fbf8f5 100%);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-hero,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-hero {
  padding:
    calc(11px + env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    17px
    max(12px, env(safe-area-inset-left));
  background: linear-gradient(180deg, #fff0b8 0%, #fff4cf 74%, rgba(255, 247, 229, 0.97) 100%);
  border-radius: 0 0 30px 30px;
  box-shadow: 0 8px 24px rgba(118, 77, 34, 0.08);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-row {
  min-height: 46px;
  padding-inline: 3px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup strong {
  font-size: 27px;
  letter-spacing: -0.9px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup p {
  margin-top: 4px;
  color: #765f4e;
  font-size: 10.5px;
  line-height: 1.3;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-back-home {
  min-height: 44px;
  color: #5f3c25;
  background: rgba(255, 253, 247, 0.92);
  border-color: rgba(208, 166, 102, 0.55);
  box-shadow: 0 9px 22px rgba(115, 73, 24, 0.11), inset 0 1px 0 #fff;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase {
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 110px;
  height: auto;
  align-items: center;
  gap: 13px;
  margin-top: 10px;
  padding: 13px;
  overflow: hidden;
  background: #fffdf9;
  border: 1px solid #e8d5c2;
  border-radius: 21px;
  box-shadow: 0 8px 20px rgba(118, 77, 34, 0.08), inset 0 1px 0 #fff;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-robot,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-robot {
  width: 92px;
  height: 58px;
  object-fit: cover;
  background: #fff2c7;
  border: 1px solid rgba(226, 190, 115, 0.52);
  border-radius: 15px;
  box-shadow: 0 6px 16px rgba(122, 79, 29, 0.1);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 3px;
  text-align: left;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #a26222;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .ai-identity-chip {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 9px;
  color: #985328;
  background: #fff8f1;
  border-color: #edcfb9;
  font-size: 12px;
  white-space: nowrap;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy h1 {
  margin: 1px 0 0;
  color: #32251d;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.35px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy p {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: #74665c;
  font-size: 12.5px;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content,
.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-content {
  position: relative;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  isolation: isolate;
  background: transparent;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("./assets/pet-mobile-brand-paw.png");
  background-repeat: no-repeat;
  background-position: center 43%;
  background-size: 126px 126px;
  content: "";
  opacity: 0.03;
  pointer-events: none;
}

.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-content::before {
  opacity: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content > * {
  position: relative;
  z-index: 1;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  width: auto;
  max-width: 406px;
  margin-inline: auto;
  padding: 0;
  background: transparent;
  border-top: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
  min-height: 118px;
  padding: 9px;
  background: rgba(255, 253, 249, 0.97);
  border: 1px solid rgba(211, 190, 170, 0.92);
  border-radius: 23px;
  box-shadow: 0 10px 28px rgba(94, 60, 27, 0.12), inset 0 1px 0 #fff;
  backdrop-filter: blur(20px);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer:focus-within {
  border-color: #e7a23c;
  box-shadow: 0 0 0 3px rgba(231, 162, 60, 0.13), 0 10px 28px rgba(94, 60, 27, 0.12);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer > textarea {
  padding: 10px 11px 5px;
  color: #3b322c;
  font-size: 16px;
  line-height: 1.5;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-speaker-line span {
  font-size: 12px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .reply-card .prompt-card,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-chat-turn .prompt-card {
  background: #fffdf9;
  border: 1px solid #e8d5c2;
  box-shadow: 0 8px 20px rgba(118, 77, 34, 0.08);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .prompt-card-head button {
  min-height: 44px;
  font-size: 12px;
}

.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase {
  grid-template-columns: 68px minmax(0, 1fr);
  min-height: 80px;
  gap: 11px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 18px;
}

.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-robot {
  width: 68px;
  height: 46px;
  border-radius: 13px;
}

.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-copy h1 {
  margin: 0;
  font-size: 18px;
}

.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-copy p {
  display: none;
}

@media (min-width: 350px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-back-home {
    width: auto;
    min-width: 72px;
    padding: 0 11px 0 13px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-back-home span {
    display: inline;
  }
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-hero,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-hero {
    padding-inline: 10px;
    border-radius: 0 0 27px 27px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup strong {
    font-size: 24px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup p {
    font-size: 10.5px;
  }

  .phone-app[data-active-screen="assistant"]:not(.has-assistant-reply) #assistantScreen .assistant-showcase {
    grid-template-columns: 84px minmax(0, 1fr);
    min-height: 104px;
    gap: 11px;
    padding: 12px;
    border-radius: 20px;
  }

  .phone-app[data-active-screen="assistant"]:not(.has-assistant-reply) #assistantScreen .assistant-showcase-robot {
    width: 84px;
    height: 54px;
    border-radius: 14px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line {
    gap: 5px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line > span:first-child {
    font-size: 12px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .ai-identity-chip {
    padding-inline: 6px;
    font-size: 12px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy h1 {
    font-size: 20px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-toolbar {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-toolbar::-webkit-scrollbar {
    display: none;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    width: max-content;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy p {
    font-size: 12px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
    right: 12px;
    width: min(calc(100% - 24px), 406px);
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
    min-height: 116px;
    padding: 8px;
    border-radius: 22px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-divider {
    display: none;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"] {
    display: inline-flex;
  }
}

/* v167 profile onboarding rhythm: compact identity, one clear next step. */
.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation {
  position: relative;
  order: 3;
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 17px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 204, 91, 0.25), transparent 38%),
    linear-gradient(145deg, #fffdf8, #fff5e3);
  border: 1px solid rgba(225, 198, 159, 0.68);
  border-radius: 22px;
  box-shadow: none;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation[hidden] {
  display: none;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation > img {
  position: absolute;
  top: -13px;
  right: -10px;
  width: 84px;
  height: 84px;
  opacity: 0.08;
  transform: rotate(11deg);
  pointer-events: none;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-copy > span {
  color: #9b571e;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.02em;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-copy > h2 {
  max-width: 250px;
  margin: 0;
  color: #36271e;
  font-size: 19px;
  font-weight: 860;
  letter-spacing: -0.025em;
  line-height: 1.24;
  text-wrap: balance;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-copy > p {
  max-width: 280px;
  margin: 0;
  color: #74665a;
  font-size: 12px;
  line-height: 1.55;
  text-wrap: pretty;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-actions > button {
  min-width: 0;
  min-height: 44px;
  padding-inline: 12px;
  color: #705138;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(215, 187, 150, 0.72);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 760;
  box-shadow: none;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-actions > button:first-child {
  color: #39240e;
  background: linear-gradient(135deg, #ffc750, #ffad1c);
  border-color: #efa722;
  box-shadow: 0 8px 18px rgba(211, 128, 22, 0.17);
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-actions > button:focus-visible {
  outline: 3px solid rgba(169, 72, 8, 0.32);
  outline-offset: 2px;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-subpanel {
  order: 4;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-identity-card.is-empty-stats {
  min-height: 172px;
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation {
    padding: 15px;
    border-radius: 20px;
  }

  .phone-app[data-active-screen="profile"] #profileScreen .profile-first-creation-copy > h2 {
    font-size: 18px;
  }
}

@media (max-width: 280px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 6px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    flex: 0 0 58px;
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    border-radius: 999px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    flex: 0 0 54px;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    border-radius: 999px;
  }
}

@media (max-width: 374px) {
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-card {
    aspect-ratio: 1.48 / 1;
  }
}

/* v166 grouped settings: personal choices stay primary; technical and destructive actions stay disclosed. */
.phone-app.is-profile-panel-open #profileScreen .profile-settings-panel {
  gap: 12px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-status {
  min-height: 34px;
  margin: -2px 2px 0;
  padding: 8px 11px;
  color: #6f5d4f;
  background: #fff8ea;
  border: 1px solid #efe1ca;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.45;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure {
  overflow: clip;
  margin: 0;
  background: #fffdf9;
  border: 1px solid #eadfd1;
  border-radius: 20px;
  box-shadow: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group {
  display: grid;
  gap: 0;
  padding: 13px 14px 4px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group-head {
  display: grid;
  gap: 1px;
  padding: 0 1px 10px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group-head > span,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure summary small {
  color: #a25c25;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group-head > strong,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure summary strong {
  color: #3b3028;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group > label {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  min-height: 62px;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid #f0e7dc;
  border-radius: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group > label > span {
  color: #66594f;
  font-size: 12px;
  font-weight: 760;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group input,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-group select,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  color: #362d27;
  background-color: #fff;
  border: 1px solid #e2d5c6;
  border-radius: 12px;
  outline: none;
  font-size: 16px;
  font-weight: 720;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group input:focus-visible,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-group select:focus-visible,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure input:focus-visible {
  border-color: #dfad64;
  box-shadow: 0 0 0 3px rgba(223, 173, 100, 0.16);
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group .profile-avatar-setting {
  min-height: 66px;
  padding: 8px 0 11px;
  background: transparent;
  border: 0;
  border-top: 1px solid #f0e7dc;
  border-radius: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-group .profile-avatar-setting > button {
  min-width: 64px;
  padding-inline: 13px;
  color: #7d4e26;
  background: #fff4df;
  border: 1px solid #ead1aa;
  border-radius: 999px;
  box-shadow: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure > summary {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure > summary::-webkit-details-marker {
  display: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure > summary > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure > summary > b {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  color: #78543a;
  background: #f7f0e7;
  border: 1px solid #e9ddcf;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure[open] > summary {
  border-bottom: 1px solid #eee4d8;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure[open] > summary > b {
  font-size: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure[open] > summary > b::after {
  content: "收起";
  font-size: 11px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure-content {
  display: grid;
  gap: 10px;
  padding: 13px 14px 14px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure-content > label {
  display: grid;
  gap: 7px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure-content > label > span {
  color: #5e5046;
  font-size: 12px;
  font-weight: 800;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure-content > label > small,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-disclosure-content > p {
  margin: 0;
  color: #817468;
  font-size: 11px;
  line-height: 1.55;
}

.phone-app.is-profile-panel-open #profileScreen .profile-connection-settings .profile-settings-disclosure-content > button {
  min-height: 44px;
  color: #75471f;
  background: #fff3df;
  border: 1px solid #ead0a8;
  border-radius: 14px;
  box-shadow: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-data-settings .profile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-data-settings .profile-actions button {
  min-height: 46px;
  color: #665447;
  background: #fff;
  border: 1px solid #e8ddd0;
  border-radius: 14px;
  box-shadow: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-data-settings .profile-actions #clearAllDataBtn {
  color: #a2413d;
  background: #fff5f3;
  border-color: #efcfcb;
}

.phone-app.is-profile-panel-open #profileScreen .profile-settings-privacy-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #7a5b43;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 340px) {
  .phone-app.is-profile-panel-open #profileScreen .profile-settings-group > label {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

/* v152 refinement: clearer root-page hierarchy, intentional empty canvas, and compact mobile priorities. */
#profileScreen .profile-page-heading {
  min-width: 0;
}

#profileScreen .profile-page-heading h1 {
  margin: 0;
  color: #2f2017;
  font-size: clamp(27px, 7.6vw, 31px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -1px;
  text-wrap: balance;
}

#profileScreen .profile-page-heading p {
  margin: 5px 0 0;
  color: #74645a;
  font-size: 11.5px;
  font-weight: 580;
  line-height: 1.35;
}

#profileScreen .profile-pet-setup {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  min-width: 78px;
  min-height: 44px;
  padding-inline: 12px;
  color: #754717;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(214, 148, 49, 0.38);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(114, 69, 18, 0.1);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 750;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content::before {
  background-size: 96px 96px;
  opacity: 0.075;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite {
  isolation: isolate;
  padding-inline: 7px;
  background: transparent;
  backdrop-filter: none;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite::before {
  position: absolute;
  inset: 7px 2px;
  z-index: -1;
  background: rgba(24, 18, 13, 0.5);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  content: "";
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite.is-active::before {
  background: rgba(225, 53, 72, 0.78);
}

@media (max-width: 360px) {
  .phone-app[data-active-screen="home"] #homeScreen .home-action-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding-inline: 2px;
  }

  .phone-app[data-active-screen="home"] #homeScreen .home-action-grid > button,
  .phone-app[data-active-screen="home"] #homeScreen .home-action-grid > a {
    min-width: 0;
    min-height: 74px;
    padding-inline: 1px;
  }

  #profileScreen .profile-pet-setup {
    right: 12px;
    min-width: 0;
    padding-inline: 10px;
    font-size: 12px;
  }
}

/* Premium coherence: one navigation language, intentional empty space, and calmer touch feedback. */
.phone-app > .bottom-nav > button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.phone-app > .bottom-nav > button.is-active {
  color: var(--color-brand-strong);
  background: linear-gradient(180deg, rgba(255, 240, 205, 0.82), rgba(255, 249, 238, 0.42));
  border-color: rgba(230, 177, 92, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.phone-app > .bottom-nav > button:focus-visible {
  outline: 3px solid rgba(169, 72, 8, 0.32);
  outline-offset: -2px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content::before {
  background-position: center 42%;
  background-size: 132px 132px;
  opacity: 0.05;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 43%, rgba(255, 201, 92, 0.12), transparent 31%),
    radial-gradient(circle at 72% 27%, rgba(255, 235, 192, 0.2), transparent 24%);
  content: "";
  pointer-events: none;
}

.phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-content::after {
  opacity: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  gap: 8px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button {
  min-height: 44px;
  gap: 6px;
  padding-inline: 11px;
  color: #66584d;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #e7dbcf;
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button.is-active {
  color: #7b4617;
  background: #fff2d5;
  border-color: #e8c88f;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button > img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 6px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > .assistant-add-reference {
  width: 44px;
  padding: 0;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-identity-card {
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.42), transparent 27%),
    linear-gradient(135deg, #ffe691 0%, #ffd45f 58%, #ffc74d 100%);
  border-color: rgba(230, 177, 76, 0.62);
  border-radius: var(--radius-hero);
  box-shadow: 0 14px 32px rgba(126, 79, 22, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-actions {
  gap: 2px;
  padding: 3px;
  background: rgba(28, 21, 16, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 15px;
  backdrop-filter: blur(10px) saturate(1.12);
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-actions button {
  min-height: 44px;
  padding-inline: 7px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
}

.phone-app > .app-screen.is-active {
  animation: pet-screen-enter var(--motion-standard) var(--ease-out) both;
}

@keyframes pet-screen-enter {
  from {
    opacity: 0.88;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .home-action-grid > button:hover,
  .home-action-grid > a:hover {
    border-color: rgba(224, 181, 111, 0.72);
    box-shadow: 0 12px 26px rgba(74, 48, 25, 0.11);
    transform: translateY(-2px);
  }
}

.home-action-grid > button:active,
.home-action-grid > a:active,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button:active {
  transform: scale(0.98);
}

.home-action-grid > [data-internal-tool-entry].is-opening {
  color: #8b4d15;
  background: #fff3df;
  box-shadow: inset 0 0 0 1px rgba(224, 181, 111, 0.72);
  transform: scale(0.98);
}

.home-action-grid > [data-internal-tool-entry].is-opening .home-action-art {
  box-shadow: 0 0 0 3px rgba(246, 183, 60, 0.18);
}

@media (max-width: 360px) {
  .app-screen-home .case-strip {
    display: grid;
    grid-auto-columns: clamp(104px, 34vw, 112px);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 9px;
    padding: 1px var(--page-gutter) 5px 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: none;
  }

  .app-screen-home .case-strip button {
    width: 100%;
    height: 98px;
    scroll-snap-align: start;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    width: 44px;
    padding-inline: 0;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"] > span,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] > span {
    display: none;
  }
}

@media (max-width: 280px) {
  .phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control,
  .phone-app.is-profile-panel-open #profileScreen .profile-social-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-social-grid > .profile-social-provider-wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-app > .app-screen.is-active {
    animation: none;
  }

  .bottom-nav > button,
  .bottom-nav .assistant-nav-button img,
  .home-action-grid > button,
  .home-action-grid > a,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button {
    transition: none;
  }
}

/* Final Agent dock geometry: centered, notch-safe, and immune to legacy translate rules. */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
  right: max(14px, env(safe-area-inset-right));
  left: max(14px, env(safe-area-inset-left));
  width: auto;
  max-width: 406px;
  margin-inline: auto;
  transform: none;
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
    right: max(8px, env(safe-area-inset-right));
    left: max(8px, env(safe-area-inset-left));
  }
}

@media (min-width: 380px) {
  .phone-app[data-active-screen="assistant"]:not(.has-assistant-reply) #assistantScreen .assistant-showcase {
    grid-template-columns: 100px minmax(0, 1fr);
    min-height: 116px;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
  }

  .phone-app[data-active-screen="assistant"]:not(.has-assistant-reply) #assistantScreen .assistant-showcase-robot {
    width: 100px;
    height: 62px;
    border-radius: 16px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy h1 {
    font-size: 23px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy p {
    font-size: 13px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
    right: 16px;
    width: min(calc(100% - 32px), 406px);
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
    min-height: 120px;
    border-radius: 24px;
  }
}

/* Focused account workspace: keep the profile flow readable above the mobile dock. */
html.is-profile-panel-open,
body.is-profile-panel-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.phone-app.is-profile-panel-open #profileScreen {
  isolation: isolate;
  overflow: hidden;
  animation: none;
  transform: none;
}

.phone-app.is-profile-panel-open .bottom-nav {
  visibility: hidden;
  opacity: 0;
  transform: translateY(calc(100% + env(safe-area-inset-bottom)));
  pointer-events: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-page-content {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-membership-card p {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.phone-app.is-profile-panel-open #profileScreen .profile-subpanel:not([hidden]) {
  position: fixed;
  top: 0;
  right: auto;
  bottom: 0;
  left: 50%;
  z-index: 100;
  box-sizing: border-box;
  display: grid;
  width: min(100%, var(--app-shell-max-width));
  max-width: var(--app-shell-max-width);
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  align-content: start;
  gap: 14px;
  margin: 0;
  scroll-margin-top: max(12px, env(safe-area-inset-top));
  scroll-padding-top: calc(82px + env(safe-area-inset-top));
  scroll-padding-bottom: max(28px, env(safe-area-inset-bottom));
  padding:
    0
    max(18px, env(safe-area-inset-right))
    max(28px, calc(env(safe-area-inset-bottom) + 18px))
    max(18px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #332720;
  background:
    radial-gradient(circle at 86% 5%, rgba(255, 211, 103, 0.2), transparent 190px),
    linear-gradient(180deg, #fffefa 0%, #fffaf4 100%);
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 48px rgba(73, 45, 22, 0.18);
  transform: translateX(-50%);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.phone-app.is-profile-panel-open #profileScreen .profile-panel-head {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: calc(70px + env(safe-area-inset-top));
  margin: 0;
  padding: max(14px, calc(env(safe-area-inset-top) + 8px)) 0 14px;
  background: linear-gradient(180deg, #fffefa 82%, rgba(255, 254, 250, 0.94) 100%);
  border-bottom: 1px solid rgba(230, 215, 199, 0.76);
  backdrop-filter: blur(12px) saturate(1.06);
}

.phone-app.is-profile-panel-open #profileScreen .profile-panel-head span {
  font-size: 12px;
  letter-spacing: 0.8px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-panel-head strong {
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.5px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-panel-head strong[tabindex="-1"]:focus {
  outline: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-panel-head > button {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 13px;
  font-size: 12px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-subpanel :where(button, a, input, select, textarea):focus-visible {
  position: relative;
  z-index: 2;
  outline: 3px solid rgba(169, 72, 8, 0.38);
  outline-offset: 2px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabpanel > label,
.phone-app.is-profile-panel-open #profileScreen .profile-settings-panel > label,
.phone-app.is-profile-panel-open #profileScreen .profile-avatar-setting,
.phone-app.is-profile-panel-open #profileScreen .profile-actions {
  scroll-margin-block: calc(82px + env(safe-area-inset-top)) 24px;
}

/* Points center: a compact wallet and receipt-like ledger inside the account sheet. */
.phone-app.is-profile-panel-open #profileScreen .profile-points-center:not([hidden]) {
  display: grid;
  gap: 12px;
  scroll-margin-block: calc(82px + env(safe-area-inset-top)) 24px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 138px;
  padding: 18px;
  overflow: hidden;
  color: #3b2614;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 255, 255, 0.64), transparent 82px),
    linear-gradient(135deg, #ffd878 0%, #f6b443 54%, #ed9f2d 100%);
  border: 1px solid #e6a134;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(122, 72, 20, 0.16);
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet::after {
  position: absolute;
  right: 16px;
  bottom: -34px;
  z-index: -1;
  width: 112px;
  height: 112px;
  content: "";
  border: 18px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet > div {
  min-width: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet > div > span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet strong {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  color: #38210f;
  font-size: clamp(28px, 9vw, 38px);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet strong output {
  overflow-wrap: anywhere;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet strong small {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet p {
  margin: 8px 0 0;
  color: rgba(59, 38, 20, 0.72);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-wallet > button {
  align-self: start;
  min-width: 56px;
  min-height: 44px;
  padding-inline: 12px;
  color: #603a16;
  background: rgba(255, 253, 246, 0.76);
  border: 1px solid rgba(111, 66, 22, 0.2);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(101, 59, 17, 0.09);
  font-size: 12px;
  font-weight: 750;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-section,
.phone-app.is-profile-panel-open #profileScreen .profile-points-history {
  display: grid;
  gap: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #eadfd4;
  border-radius: 18px;
  box-shadow: 0 5px 16px rgba(74, 47, 25, 0.05);
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-section-head {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-section-head > div {
  min-width: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-section-head span {
  display: block;
  margin-bottom: 2px;
  color: #a65b18;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-section-head h3 {
  margin: 0;
  color: #3f3026;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-section-head > small {
  flex: 0 0 auto;
  color: #8c7b6d;
  font-size: 11px;
  line-height: 1.4;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding: 13px;
  color: #4f3a2b;
  background: #fff9ef;
  border: 1px solid #ead9c4;
  border-radius: 15px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan header {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan header > span {
  min-width: 0;
  font-size: 12px;
  font-weight: 750;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan header > strong {
  flex: 0 0 auto;
  color: #873f0c;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan header > strong small {
  margin-right: 1px;
  font-size: 11px;
  font-weight: 750;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan p {
  margin: 1px 0 0;
  color: #5e493a;
  font-size: 12px;
  line-height: 1.35;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan p b {
  color: inherit;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan > small {
  color: #8b7869;
  font-size: 10.5px;
  line-height: 1.45;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan-advanced {
  color: #fff5dc;
  background:
    radial-gradient(circle at 94% 0%, rgba(255, 202, 102, 0.25), transparent 72px),
    linear-gradient(145deg, #5c3922 0%, #3f281b 100%);
  border-color: #6a432a;
  box-shadow: 0 8px 18px rgba(65, 39, 23, 0.13);
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan-advanced header > strong,
.phone-app.is-profile-panel-open #profileScreen .profile-points-plan-advanced p {
  color: #fff0c4;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan-advanced > small {
  color: rgba(255, 243, 215, 0.7);
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-plan button,
.phone-app.is-profile-panel-open #profileScreen .profile-points-topup > button {
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  padding-inline: 12px;
  color: #3e2715;
  background: #f4b23f;
  border: 1px solid #e39c2b;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-topup > label {
  color: #655548;
  font-size: 12px;
  font-weight: 700;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-topup-control {
  display: grid;
  grid-template-columns: 34px minmax(72px, 0.58fr) minmax(132px, 1fr);
  min-height: 52px;
  align-items: center;
  overflow: hidden;
  background: #fffcf8;
  border: 1px solid #dfd1c2;
  border-radius: 13px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-topup-control > span {
  align-self: stretch;
  display: grid;
  place-items: center;
  color: #8a4b17;
  background: #fff2dc;
  border-right: 1px solid #ead8c3;
  font-size: 15px;
  font-weight: 800;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-topup-control input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 9px;
  color: #3e3026;
  background: transparent;
  border: 0;
  border-right: 1px solid #eadfd4;
  border-radius: 0;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-topup-control output {
  min-width: 0;
  padding: 8px 10px;
  color: #7d5a3e;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-topup > small {
  color: #8a796c;
  font-size: 10.5px;
  line-height: 1.45;
}

.phone-app.is-profile-panel-open #profileScreen #profilePointsTransactions {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: #fffaf3;
  border: 1px solid #ede1d5;
  border-radius: 13px;
}

.phone-app.is-profile-panel-open #profileScreen #profilePointsTransactions > p {
  min-height: 54px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 12px;
  color: #948578;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.phone-app.is-profile-panel-open #profileScreen #profilePointsTransactions > :where(article, div),
.phone-app.is-profile-panel-open #profileScreen .profile-points-transaction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid #eee3d8;
}

.phone-app.is-profile-panel-open #profileScreen #profilePointsTransactions > :where(article, div):last-child,
.phone-app.is-profile-panel-open #profileScreen .profile-points-transaction:last-child {
  border-bottom: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-transaction :where(strong, b),
.phone-app.is-profile-panel-open #profileScreen #profilePointsTransactions > :where(article, div) > :where(strong, b) {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-transaction :where(small, time),
.phone-app.is-profile-panel-open #profileScreen #profilePointsTransactions > :where(article, div) :where(small, time) {
  color: #8e7e71;
  font-size: 10px;
  line-height: 1.4;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-transaction .is-credit,
.phone-app.is-profile-panel-open #profileScreen #profilePointsTransactions .is-credit {
  color: var(--color-success);
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-transaction .is-debit,
.phone-app.is-profile-panel-open #profileScreen #profilePointsTransactions .is-debit {
  color: #9c4e1a;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-status {
  min-height: 44px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  color: #765b46;
  background: #fff4df;
  border: 1px solid #ecd7b5;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-status:is(.is-success, [data-state="success"]) {
  color: #285f46;
  background: #eff8f2;
  border-color: #cce4d6;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-status:is(.is-error, [data-state="error"]) {
  color: #8d3535;
  background: #fff1ef;
  border-color: #edcfca;
}

.phone-app.is-profile-panel-open #profileScreen .profile-points-policy-note {
  margin: -2px 2px 2px;
  color: #8d7e72;
  font-size: 10px;
  line-height: 1.55;
}

@media (max-width: 360px) {
  .phone-app.is-profile-panel-open #profileScreen .profile-points-plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-points-plan {
    padding: 14px;
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-points-topup-control {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-points-topup-control output {
    grid-column: 1 / -1;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-top: 1px solid #eadfd4;
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-points-topup-control input {
    border-right: 0;
  }
}

/* Static Lakala payment sheet: preserve the whole code image and keep verification explicit. */
.phone-app .profile-points-payment-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding:
    max(10px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  overflow: hidden;
  color: #3c2c22;
  background: transparent;
  border: 0;
}

.phone-app .profile-points-payment-dialog[open] {
  display: grid;
  place-items: center;
}

.phone-app .profile-points-payment-dialog::backdrop {
  background: rgba(42, 27, 17, 0.64);
  -webkit-backdrop-filter: blur(8px) saturate(0.86);
  backdrop-filter: blur(8px) saturate(0.86);
}

.phone-app .profile-points-payment-dialog > article {
  box-sizing: border-box;
  display: grid;
  width: min(100%, var(--app-shell-max-width));
  max-height: 100%;
  align-content: start;
  gap: 14px;
  padding: 18px 17px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #3c2c22;
  background:
    radial-gradient(circle at 92% 2%, rgba(255, 211, 103, 0.22), transparent 150px),
    linear-gradient(180deg, #fffefa 0%, #fff8ef 100%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 26px;
  box-shadow: 0 28px 72px rgba(50, 30, 16, 0.34);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.phone-app .profile-points-payment-head {
  position: sticky;
  top: -18px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: -18px -2px 0;
  padding: 18px 2px 12px;
  background: linear-gradient(180deg, #fffefa 78%, rgba(255, 254, 250, 0.94) 100%);
  border-bottom: 1px solid rgba(231, 216, 200, 0.72);
  backdrop-filter: blur(10px);
}

.phone-app .profile-points-payment-head > div {
  min-width: 0;
}

.phone-app .profile-points-payment-head span {
  display: block;
  margin-bottom: 3px;
  color: #a65b18;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.phone-app .profile-points-payment-head h2 {
  margin: 0;
  color: #3c281a;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.phone-app .profile-points-payment-head > button {
  min-width: 52px;
  min-height: 44px;
  padding-inline: 12px;
  color: #765f4c;
  background: #f7eee5;
  border: 1px solid #e8dacd;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.phone-app .profile-points-payment-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px;
  color: #432b17;
  background:
    radial-gradient(circle at 96% 8%, rgba(255, 255, 255, 0.58), transparent 70px),
    linear-gradient(135deg, #ffe29a 0%, #ffc95d 100%);
  border: 1px solid #efbd56;
  border-radius: 17px;
  box-shadow: 0 8px 20px rgba(130, 79, 24, 0.11);
}

.phone-app .profile-points-payment-summary > div {
  min-width: 0;
  padding-inline: 12px;
}

.phone-app .profile-points-payment-summary > div:first-child {
  padding-left: 0;
  border-right: 1px solid rgba(104, 63, 20, 0.2);
}

.phone-app .profile-points-payment-summary > div:last-child {
  padding-right: 0;
}

.phone-app .profile-points-payment-summary span {
  display: block;
  margin-bottom: 5px;
  color: rgba(67, 43, 23, 0.7);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
}

.phone-app .profile-points-payment-summary strong {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
  color: #3d2614;
  font-size: clamp(19px, 6.6vw, 27px);
  font-variant-numeric: tabular-nums;
  font-weight: 880;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.phone-app .profile-points-payment-summary output {
  min-width: 0;
  overflow-wrap: anywhere;
}

.phone-app .profile-points-payment-summary small {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
}

.phone-app .profile-points-payment-qr {
  box-sizing: border-box;
  display: grid;
  width: min(100%, 360px);
  justify-self: center;
  gap: 10px;
  margin: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(67, 42, 24, 0.08);
}

.phone-app .profile-points-payment-qr img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eee4db;
  border-radius: 12px;
}

.phone-app .profile-points-payment-qr figcaption {
  display: grid;
  gap: 3px;
  padding: 2px 3px 3px;
  text-align: center;
}

.phone-app .profile-points-payment-qr figcaption span {
  color: #9c6c43;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.phone-app .profile-points-payment-qr figcaption strong {
  color: #463428;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.phone-app .profile-points-payment-qr figcaption small {
  color: #817268;
  font-size: 10px;
  line-height: 1.5;
}

.phone-app .profile-points-payment-proof {
  display: grid;
  gap: 8px;
  padding: 14px 14px 13px 15px;
  background: #fff3e7;
  border: 1px solid #efcfad;
  border-left: 4px solid #d77726;
  border-radius: 15px;
}

.phone-app .profile-points-payment-proof > strong {
  color: #85420f;
  font-size: 13px;
  font-weight: 850;
}

.phone-app .profile-points-payment-proof > p {
  margin: 0;
  color: #765d49;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.55;
}

.phone-app .profile-points-payment-proof dl {
  display: grid;
  gap: 0;
  margin: 2px 0 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(221, 190, 158, 0.8);
  border-radius: 11px;
}

.phone-app .profile-points-payment-proof dl > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border-bottom: 1px solid rgba(226, 201, 176, 0.72);
}

.phone-app .profile-points-payment-proof dl > div:last-child {
  border-bottom: 0;
}

.phone-app .profile-points-payment-proof dt,
.phone-app .profile-points-payment-proof dd {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.45;
}

.phone-app .profile-points-payment-proof dt {
  color: #8a715c;
  font-weight: 700;
}

.phone-app .profile-points-payment-proof dd {
  color: #4d3829;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  overflow-wrap: anywhere;
  user-select: all;
}

.phone-app .profile-points-payment-dialog > article > footer {
  position: sticky;
  bottom: -16px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0 -2px -16px;
  padding: 12px 2px 16px;
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.9), #fff8ef 28%);
  border-top: 1px solid rgba(230, 215, 199, 0.74);
  backdrop-filter: blur(10px);
}

.phone-app .profile-points-payment-dialog > article > footer button {
  min-width: 0;
  min-height: 48px;
  padding-inline: 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
}

.phone-app .profile-points-payment-dialog > article > footer button:first-child {
  color: #725d4d;
  background: #f2e9df;
  border: 1px solid #e2d4c7;
}

.phone-app .profile-points-payment-dialog > article > footer button:last-child {
  color: #3d2815;
  background: linear-gradient(180deg, #f8c45d, #efa93a);
  border: 1px solid #dc9228;
  box-shadow: 0 8px 18px rgba(142, 83, 22, 0.18);
}

.phone-app .profile-points-payment-dialog :where(button, img):focus-visible {
  outline: 3px solid rgba(169, 72, 8, 0.38);
  outline-offset: 2px;
}

@media (max-width: 360px) {
  .phone-app .profile-points-payment-dialog {
    padding: 0;
  }

  .phone-app .profile-points-payment-dialog > article {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    gap: 12px;
    padding:
      max(14px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-app .profile-points-payment-head {
    top: calc(0px - max(14px, env(safe-area-inset-top)));
    margin:
      calc(0px - max(14px, env(safe-area-inset-top)))
      0
      0;
    padding:
      max(14px, env(safe-area-inset-top))
      0
      11px;
  }

  .phone-app .profile-points-payment-head h2 {
    font-size: 19px;
  }

  .phone-app .profile-points-payment-summary {
    padding: 12px;
  }

  .phone-app .profile-points-payment-summary > div {
    padding-inline: 9px;
  }

  .phone-app .profile-points-payment-qr {
    width: 100%;
    padding: 8px;
    border-radius: 15px;
  }

  .phone-app .profile-points-payment-proof {
    padding: 13px 12px;
  }

  .phone-app .profile-points-payment-dialog > article > footer {
    bottom: calc(0px - max(14px, env(safe-area-inset-bottom)));
    margin:
      0
      0
      calc(0px - max(14px, env(safe-area-inset-bottom)));
    padding:
      11px
      0
      max(14px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 300px) {
  .phone-app .profile-points-payment-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-app .profile-points-payment-summary > div {
    padding: 9px 0;
  }

  .phone-app .profile-points-payment-summary > div:first-child {
    border-right: 0;
    border-bottom: 1px solid rgba(104, 63, 20, 0.2);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .phone-app .profile-points-payment-dialog::backdrop,
  .phone-app .profile-points-payment-head,
  .phone-app .profile-points-payment-dialog > article > footer {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-form {
  gap: 12px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabs {
  gap: 5px;
  padding: 5px;
  background: #f6eee5;
  border: 1px solid #eadfd4;
  border-radius: 16px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabs button {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabs button.is-active {
  color: #4d2f1b;
  box-shadow: inset 0 0 0 1px #ead7c1;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabpanel > label:not(.profile-auth-consent) {
  grid-template-columns: 1fr;
  min-height: 0;
  gap: 8px;
  padding: 0 2px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabpanel > label:not(.profile-auth-consent) > span:first-child {
  color: #655548;
  font-size: 12px;
  line-height: 1.3;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-tabpanel > label > span:first-child > small {
  margin-left: 4px;
  color: #95877b;
  font-size: 11px;
  font-weight: 500;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-form input:not([type="checkbox"]) {
  min-height: 44px;
  padding-inline: 12px;
  background: #fff;
  border-color: #ded1c4;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 600;
}

.phone-app.is-profile-panel-open #profileScreen .profile-password-control {
  position: relative;
  display: block;
  min-width: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-password-control > input {
  width: 100%;
  padding-right: 64px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-password-control > button {
  position: absolute;
  top: 50%;
  right: 0;
  min-width: 52px;
  min-height: 44px;
  padding-inline: 10px;
  color: #8d4f1b;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  transform: translateY(-50%);
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-form input:not([type="checkbox"]):focus-visible {
  outline: 3px solid rgba(203, 122, 34, 0.2);
  outline-offset: 1px;
  border-color: #d58b34;
  box-shadow: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-register-code-help {
  color: #796a5e;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.phone-app.is-profile-panel-open #profileScreen .profile-register-code-help a {
  display: inline-block;
  margin: -14px -2px;
  padding: 14px 2px;
  color: #995619;
  font-weight: 760;
  text-decoration: underline;
  text-decoration-color: rgba(153, 86, 25, 0.38);
  text-underline-offset: 3px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-consent {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 52px;
  align-items: start;
  gap: 10px;
  padding: 12px;
  color: #66574b;
  background: #fff8ed;
  border: 1px solid #ead8bf;
  border-radius: 14px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-consent input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #dc8d20;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-consent > span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-status {
  min-height: 20px;
  margin: 0 2px;
  color: #76685e;
  font-size: 12px;
  line-height: 1.5;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-help {
  width: fit-content;
  min-height: 44px;
  margin: -8px 2px 0;
  color: #9b5b20;
  font-size: 12px;
  font-weight: 600;
  line-height: 44px;
  text-decoration: underline;
  text-decoration-color: rgba(155, 91, 32, 0.38);
  text-underline-offset: 3px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-submit {
  min-height: 48px;
  color: #3d260d;
  background: linear-gradient(135deg, #ffc348 0%, #ffa514 100%);
  border-color: #f0a21a;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(212, 128, 21, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 15px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-security {
  display: grid;
  gap: 11px;
  margin-top: 12px;
  padding: 14px;
  background: #f4fbf8;
  border: 1px solid #cce5dc;
  border-radius: 16px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-security[hidden] {
  display: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-security > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-security > header > div {
  display: grid;
  gap: 2px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-security > header span {
  color: #4d8a77;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-security h3 {
  margin: 0;
  color: #3f3026;
  font-size: 15px;
  font-weight: 850;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-security > header > strong {
  max-width: 54%;
  padding: 6px 10px;
  overflow: hidden;
  color: #276956;
  background: #e2f3ed;
  border: 1px solid #c1e0d5;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-security > p,
.phone-app.is-profile-panel-open #profileScreen .profile-phone-bind-status {
  margin: 0;
  color: #75685e;
  font-size: 11.5px;
  line-height: 1.5;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-bind-form {
  display: grid;
  gap: 11px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-bind-form > .profile-auth-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-bind-form input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding-inline: 12px;
  color: #3b312b;
  background: #fff;
  border: 1px solid #d9cfc4;
  border-radius: 11px;
  outline: none;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-bind-form input:focus-visible {
  outline: 3px solid rgba(35, 115, 95, 0.18);
  outline-offset: 1px;
  border-color: #5e9f8c;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-bind-form[aria-busy="true"] {
  opacity: 0.8;
}

.phone-app.is-profile-panel-open #profileScreen .profile-phone-bind-form .profile-auth-submit:disabled {
  cursor: not-allowed;
  filter: saturate(0.6);
  opacity: 0.65;
}

/* Multi-method sign-in: warm pet identity, honest provider readiness, and mobile-first controls. */
.phone-app.is-profile-panel-open #profileScreen .profile-auth-intro {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  background: #fff8e9;
  border: 1px solid #eeddbf;
  border-radius: 16px;
  box-shadow: inset 4px 0 0 #afd9c7;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-paw {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #23735f;
  background: #e3f4ed;
  border: 1px solid #c4e4d8;
  border-radius: 14px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-paw svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-intro strong,
.phone-app.is-profile-panel-open #profileScreen .profile-auth-intro p {
  display: block;
  margin: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-intro strong {
  color: #4b2f1d;
  font-size: 14px;
  font-weight: 820;
  line-height: 1.35;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-intro p {
  margin-top: 3px;
  color: #806e5f;
  font-size: 11.5px;
  font-weight: 560;
  line-height: 1.45;
}

.phone-app.is-profile-panel-open #profileScreen .profile-login-methods {
  min-width: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: #f7eee4;
  border: 1px solid #eadfd4;
  border-radius: 14px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-tabs button {
  min-width: 0;
  min-height: 44px;
  padding: 6px 5px;
  color: #7f7064;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 720;
  line-height: 1.25;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-tabs button.is-active,
.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-tabs button[aria-selected="true"] {
  color: #633814;
  background: #fff;
  border-color: #ead7c1;
  box-shadow: 0 3px 10px rgba(92, 61, 30, 0.07);
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 13px;
  background: #fffdf9;
  border: 1px solid #eadfd5;
  border-radius: 16px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-panel > .profile-auth-field,
.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-panel > label.profile-auth-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  align-items: stretch;
  gap: 7px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-field-label,
.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-panel > label.profile-auth-field > span:first-child {
  color: #655548;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-field-label small,
.phone-app.is-profile-panel-open #profileScreen .profile-auth-method-panel > label.profile-auth-field > span:first-child small {
  margin-left: 4px;
  color: #95877b;
  font-size: 11px;
  font-weight: 520;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-phone-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-country-code {
  display: grid;
  min-width: 54px;
  min-height: 44px;
  place-items: center;
  color: #65472f;
  background: #f5eee6;
  border: 1px solid #ded1c4;
  border-right: 0;
  border-radius: 11px 0 0 11px;
  font-size: 13px;
  font-weight: 760;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-phone-control > input:not([type="checkbox"]) {
  border-radius: 0 11px 11px 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control > button {
  display: grid;
  min-width: 0;
  min-height: 44px;
  align-content: center;
  gap: 1px;
  padding: 5px 9px;
  color: #6e3e16;
  background: #fff3db;
  border: 1px solid #e8cfaa;
  border-radius: 11px;
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 760;
  line-height: 1.2;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control > button small {
  color: #9c7651;
  font-size: 9.5px;
  font-weight: 650;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control > button:disabled {
  cursor: not-allowed;
  filter: saturate(0.72);
  opacity: 0.72;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control > button[data-auth-configured="true"] {
  color: #245e50;
  background: #e9f6f1;
  border-color: #bcddd2;
  filter: none;
  opacity: 1;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-login {
  display: grid;
  gap: 11px;
  padding-top: 2px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-divider {
  display: grid;
  grid-template-columns: minmax(18px, 1fr) auto minmax(18px, 1fr);
  align-items: center;
  gap: 10px;
  color: #97897d;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-divider::before,
.phone-app.is-profile-panel-open #profileScreen .profile-social-divider::after {
  height: 1px;
  background: #e9ddd1;
  content: "";
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-grid > button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  color: #4d4037;
  text-align: left;
  background: #fff;
  border: 1px solid #e5d9cc;
  border-radius: 13px;
  box-shadow: 0 3px 9px rgba(87, 59, 33, 0.045);
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-grid > button[data-auth-configured="true"] {
  border-color: #d9c7b5;
  filter: none;
  opacity: 1;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-grid > .profile-social-provider-wide {
  grid-column: 1 / -1;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-logo {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.4px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-logo-wechat {
  color: #fff;
  background: #19aa55;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-logo-qq {
  color: #fff;
  background: #2787dc;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-logo-google {
  color: #316bd8;
  background: #f5f8ff;
  border: 1px solid #dce5f7;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-logo-github,
.phone-app.is-profile-panel-open #profileScreen .profile-social-logo-apple {
  color: #fff;
  background: #252525;
  font-size: 10.5px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-copy strong,
.phone-app.is-profile-panel-open #profileScreen .profile-social-copy small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-copy strong {
  color: #4d4037;
  font-size: 12px;
  font-weight: 780;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-copy small {
  color: #99887a;
  font-size: 9.5px;
  font-weight: 620;
}

.phone-app.is-profile-panel-open #profileScreen .profile-social-note {
  margin: -2px 2px 0;
  color: #988a7f;
  font-size: 10.5px;
  font-weight: 540;
  line-height: 1.45;
  text-align: center;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-form[aria-busy="true"] .profile-auth-method-tabs,
.phone-app.is-profile-panel-open #profileScreen .profile-auth-form[aria-busy="true"] .profile-social-grid {
  pointer-events: none;
}

@media (max-width: 340px) {
  .phone-app.is-profile-panel-open #profileScreen .profile-subpanel:not([hidden]) {
    padding:
      0
      max(15px, env(safe-area-inset-right))
      max(24px, calc(env(safe-area-inset-bottom) + 15px))
      max(15px, env(safe-area-inset-left));
    border-radius: 0;
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-auth-form {
    gap: 10px;
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-auth-method-tabs button {
    padding-inline: 3px;
    font-size: 10.5px;
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-auth-method-panel {
    padding: 11px;
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control {
    grid-template-columns: minmax(0, 1fr) 102px;
    gap: 6px;
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-social-grid > button {
    gap: 7px;
    padding-inline: 8px;
  }
}

@media (max-width: 280px) {
  .phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control,
  .phone-app.is-profile-panel-open #profileScreen .profile-social-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-social-grid > .profile-social-provider-wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-app.is-profile-panel-open .bottom-nav {
    transition: none;
  }

  .phone-app.is-profile-panel-open #profileScreen .profile-auth-method-tabs button,
  .phone-app.is-profile-panel-open #profileScreen .profile-social-grid > button,
  .phone-app.is-profile-panel-open #profileScreen .profile-auth-code-control > button {
    scroll-behavior: auto;
    transition: none;
  }
}

/* Finished draft empty state: one visual anchor, one explanation, two clear actions. */
.phone-app[data-active-screen="works"] #worksScreen .works-draft-empty:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: clamp(260px, 39vh, 320px);
  align-content: center;
  justify-items: center;
  gap: 14px;
  margin: 18px 0 0;
  padding: 28px 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 211, 112, 0.2), transparent 38%),
    linear-gradient(180deg, #fffefb 0%, #fff9f1 100%);
  border: 1px solid #eadaca;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(83, 54, 29, 0.09), inset 0 1px 0 #fff;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-visual {
  width: 96px;
  height: 62px;
  object-fit: cover;
  object-position: center;
  background: #fff0bb;
  border: 1px solid #e9ca8f;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(112, 72, 29, 0.12);
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-copy {
  max-width: 290px;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-copy > span {
  color: #a96a22;
  font-size: 12px;
  line-height: 1.3;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-copy h2 {
  max-width: 13em;
  margin: 5px auto 0;
  color: #35271e;
  font-size: 21px;
  line-height: 1.25;
  text-wrap: balance;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-copy p {
  max-width: 23em;
  margin: 8px auto 0;
  color: #75675d;
  font-size: 13px;
  line-height: 1.55;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 272px);
  gap: 10px;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-actions button {
  min-width: 0;
  min-height: 46px;
  padding-inline: 13px;
  border-radius: 14px;
  font-size: 13px;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-actions button:first-child {
  color: #3d260e;
  background: linear-gradient(135deg, #ffc448 0%, #ff9f13 100%);
  border-color: #f2a520;
  box-shadow: 0 9px 20px rgba(216, 128, 17, 0.2);
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="works"] #worksScreen .works-draft-empty:not([hidden]) {
    min-height: 276px;
    padding: 24px 16px;
    border-radius: 21px;
  }

  .phone-app[data-active-screen="works"] #worksScreen .empty-work-copy h2 {
    font-size: 20px;
  }
}

/* Works gallery refinement: editorial hierarchy, symmetric carousel peeks and safe card copy. */
.phone-app[data-active-screen="works"] #worksScreen #worksDiscoverySurface::before {
  display: block;
  margin: 12px var(--works-gutter) 10px;
  padding-inline-start: 9px;
  color: #35251b;
  border-inline-start: 3px solid #eca329;
  content: "本周精选";
  font-size: 19px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-shell {
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-track {
  --works-feature-edge: clamp(22px, 6.667vw, 26px);
  --works-feature-width: clamp(276px, 86.666vw, 338px);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0 var(--works-feature-edge) 3px;
  scroll-padding-inline: var(--works-feature-edge);
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-card {
  box-sizing: border-box;
  flex-basis: var(--works-feature-width);
  max-width: var(--works-feature-width);
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-content {
  padding: 12px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-copy {
  max-width: 100%;
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-copy p,
.phone-app[data-active-screen="works"] #worksScreen .works-feature-social b,
.phone-app[data-active-screen="works"] #worksScreen .works-feature-actions button,
.phone-app[data-active-screen="works"] #worksScreen .works-feature-actions button span {
  font-size: 12px;
  line-height: 1.35;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-grid {
  align-items: stretch;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-card {
  aspect-ratio: 1.18 / 1;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 15px rgba(73, 46, 25, 0.12);
}

.phone-app[data-active-screen="works"] #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;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-rank {
  top: 12px;
  left: 12px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy,
.phone-app[data-active-screen="works"] #worksScreen .works-showcase-card:has(.works-showcase-favorite) .works-showcase-copy {
  right: 78px;
  bottom: 12px;
  left: 12px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy h3 {
  font-size: 15px;
  line-height: 1.2;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite {
  top: 12px;
  right: 12px;
  bottom: auto;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding-inline: 9px;
  font-size: 12px;
  line-height: 1;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite span {
  font-size: 12px;
  line-height: 1;
}

.phone-app[data-active-screen="works"] #worksScreen .works-draft-empty:not([hidden]) {
  width: auto;
  min-height: clamp(276px, 39vh, 320px);
  margin: 18px var(--works-gutter) 0;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-copy {
  width: 100%;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-copy h2 {
  display: -webkit-box;
  max-width: 13em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.phone-app[data-active-screen="works"] #worksScreen .empty-work-actions button {
  min-height: 46px;
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="works"] #worksScreen .works-feature-copy h2 {
    font-size: 22px;
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-feature-footer {
    gap: 6px;
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-feature-actions button {
    padding-inline: 5px;
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy,
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-card:has(.works-showcase-favorite) .works-showcase-copy {
    right: 12px;
    left: 12px;
  }
}

/* Mobile form and contextual-attachment floor. */
.phone-app[data-active-screen="home"] #homeScreen #homeQuickPromptInput,
.phone-app[data-active-screen="templates"] #templatesScreen #templateSearchInput,
.phone-app[data-active-screen="profile"] #profileScreen #petNameInput,
.phone-app[data-active-screen="profile"] #profileScreen #ratioSelect,
.phone-app[data-active-screen="profile"] #profileScreen #qualitySelect,
.phone-app[data-active-screen="profile"] #profileScreen #apiBaseInput {
  min-height: 44px;
  height: auto;
  font-size: 16px;
  line-height: 1.4;
}

.phone-app[data-active-screen="profile"] #profileScreen #profileAvatarUploadBtn {
  min-width: 64px;
  min-height: 44px;
  height: 44px;
  padding-inline: 14px;
  font-size: 13px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-chip {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 7px;
  color: #5f5045;
  background: #fff7e8;
  border: 1px solid #ead6b7;
  border-radius: 14px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-chip[hidden] {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-chip > img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid rgba(201, 153, 86, 0.35);
  border-radius: 10px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-chip > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-chip strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-chip small {
  color: #817065;
  font-size: 12px;
  line-height: 1.25;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-chip > button {
  min-width: 52px;
  min-height: 44px;
  padding-inline: 10px;
  color: #8a4b22;
  background: #fff;
  border: 1px solid #e7d3bc;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.phone-app[data-active-screen="assistant"]:has(.assistant-attachment-chip:not([hidden])) #assistantScreen .assistant-content {
  padding-bottom: calc(194px + env(safe-area-inset-bottom));
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-actions {
  gap: 8px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-feature-actions button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="home"] #homeScreen .home-brand-lockup p,
  .phone-app[data-active-screen="templates"] #templatesScreen .home-brand-lockup p,
  .phone-app[data-active-screen="profile"] #profileScreen .home-brand-lockup p,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup p {
    max-width: 190px;
    overflow: hidden;
    font-size: 10.5px;
    letter-spacing: -0.16px;
    text-overflow: clip;
    white-space: nowrap;
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-feature-social b {
    display: none;
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-feature-actions button {
    padding-inline: 5px;
  }
}

/* v152 final cascade lock: preserve the refined empty states and field-level feedback. */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-content::before {
  background-size: 96px 96px;
  opacity: 0.075;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite {
  isolation: isolate;
  padding-inline: 7px;
  background: transparent;
  backdrop-filter: none;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite::before {
  position: absolute;
  inset: 7px 2px;
  z-index: -1;
  background: rgba(24, 18, 13, 0.5);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  content: "";
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite.is-active::before {
  background: rgba(225, 53, 72, 0.78);
}

#profileScreen .profile-field-error {
  display: block;
  margin-top: 4px;
  color: #a33a2a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

#profileScreen .profile-field-error[hidden] {
  display: none;
}

.phone-app.is-profile-panel-open #profileScreen .profile-auth-consent .profile-field-error {
  grid-column: 1 / -1;
}

@media (max-width: 240px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-hero {
    padding-inline: 8px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup strong {
    font-size: 20px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup p {
    display: none;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-row,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-header-actions {
    gap: 5px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase,
  .phone-app[data-active-screen="assistant"]:not(.has-assistant-reply) #assistantScreen .assistant-showcase,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase.is-reply-variant {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    gap: 8px;
    padding: 10px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-robot,
  .phone-app[data-active-screen="assistant"]:not(.has-assistant-reply) #assistantScreen .assistant-showcase-robot {
    width: 72px;
    height: 46px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line {
    flex-wrap: wrap;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line > span:first-child {
    flex-basis: 100%;
    white-space: normal;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .ai-identity-chip {
    justify-self: start;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy h1 {
    font-size: 18px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
  }
}

/* v155 text-work refinement: compact project summaries without changing media cards. */
.phone-app[data-active-screen="works"] #worksScreen .work-list > .work-card.is-text {
  gap: 10px;
  padding: 14px;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-card-head {
  grid-template-columns: minmax(0, 1fr) auto var(--tap-min);
  grid-template-rows: auto auto;
  grid-template-areas:
    "title badge open"
    "title status open";
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-title-block {
  grid-area: title;
  align-self: center;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-title-block > strong {
  font-size: var(--text-body-strong);
  line-height: 1.28;
  letter-spacing: -0.1px;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-title-block .work-meta {
  margin-top: 4px;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .ai-content-badge {
  grid-area: badge;
  justify-self: end;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-status-pill {
  grid-area: status;
  justify-self: end;
  min-height: 24px;
  padding-inline: 8px;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-card-open {
  grid-area: open;
  align-self: center;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-card-preview,
.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-text-preview,
.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-text-preview > div {
  min-width: 0;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-text-preview {
  white-space: normal;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-text-preview > div {
  gap: 4px;
  padding: 10px 12px;
  background: #fffcf7;
  border: 1px solid var(--color-border);
  border-inline-start: 3px solid var(--color-brand);
  border-radius: var(--radius-control);
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-text-preview span {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-text-preview p {
  overflow-wrap: anywhere;
  line-height: 1.55;
  -webkit-line-clamp: 2;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-card-actions {
  grid-template-columns: minmax(0, 1.2fr) minmax(108px, 0.8fr);
  gap: 8px;
  padding-top: 2px;
}

.phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-card-actions button {
  width: 100%;
  min-width: 0;
  min-height: var(--tap-min);
  padding-inline: 12px;
  white-space: nowrap;
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="works"] #worksScreen .work-list > .work-card.is-text {
    gap: 9px;
    padding: 12px;
  }

  .phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-card-head {
    grid-template-columns: minmax(0, 1fr) var(--tap-min);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "title open"
      "badge open"
      "status open";
    column-gap: 8px;
    row-gap: 3px;
  }

  .phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .ai-content-badge,
  .phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-status-pill {
    justify-self: start;
  }

  .phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phone-app[data-active-screen="works"] #worksScreen .work-card.is-text .work-card-actions button {
    padding-inline: 8px;
  }
}

/* v155 assistant composer: use soft pills instead of square shortcut tiles. */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  gap: 6px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button:not(.assistant-add-reference) {
  flex: 0 0 auto;
  flex-direction: row;
  width: auto;
  min-width: 62px;
  max-width: none;
  height: 44px;
  padding-inline: 10px;
  gap: 6px;
  border-radius: 999px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
  flex-basis: auto;
  width: auto;
  min-width: 66px;
  max-width: none;
  border-radius: 999px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"] > span,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] > span {
  display: inline;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > .assistant-add-reference {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row > .send-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}

@media (min-width: 380px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    gap: 6px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button:not(.assistant-add-reference) {
    min-width: 64px;
    padding-inline: 7px;
    gap: 4px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    min-width: 64px;
  }
}

@media (min-width: 371px) and (max-width: 379px) {
  .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) {
    min-width: 62px;
    padding-inline: 7px;
    gap: 4px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    min-width: 64px;
  }
}

@media (max-width: 370px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"] {
    display: none;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    min-width: 68px;
  }
}

.phone-app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.phone-app select,
.phone-app textarea {
  font-size: 16px;
}

@media (max-width: 280px) {
  .phone-app > .bottom-nav {
    right: 0;
    left: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, 56px);
    gap: 4px;
    width: 100%;
    min-height: calc(130px + env(safe-area-inset-bottom));
    padding: 7px 6px max(7px, env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    transform: none;
  }

  .phone-app > .bottom-nav > button,
  .phone-app > .bottom-nav .assistant-nav-button,
  .phone-app > .bottom-nav .assistant-nav-button.is-active {
    min-width: var(--tap-min);
    min-height: 56px;
  }

  .phone-app > .bottom-nav .assistant-nav-button img,
  .phone-app > .bottom-nav .assistant-nav-button.is-active img {
    width: 28px;
    height: 28px;
    border-width: 2px;
    transform: none;
  }

  .phone-app[data-active-screen="home"] #homeScreen .home-content,
  .phone-app[data-active-screen="templates"] #templatesScreen .screen-content,
  .phone-app[data-active-screen="works"] #worksScreen .works-page-content,
  .phone-app[data-active-screen="profile"] #profileScreen .profile-page-content {
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
    right: max(4px, env(safe-area-inset-right));
    left: max(4px, env(safe-area-inset-left));
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    justify-content: space-between;
    gap: 8px;
    overflow: visible;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-divider,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"] {
    display: none;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > .assistant-add-reference,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding-inline: 0;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row > .send-button {
    justify-self: end;
  }
}

/* v165: keep every composer action circular or pill-shaped, including large text and extreme widths. */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-mode-popover button {
  min-height: 44px;
  border-radius: 999px;
}

@media (max-width: 280px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 6px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    flex-basis: 58px;
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    border-radius: 999px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    flex-basis: 54px;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    border-radius: 999px;
  }
}

/* v163 final shortcut geometry: circles stay circular, capabilities stay elongated. */
@media (max-width: 370px) and (min-width: 281px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    flex: 0 0 76px;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding-inline: 11px;
    border-radius: 999px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    flex: 0 0 72px;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    padding-inline: 9px;
    border-radius: 999px;
  }
}

.creator-settings-dialog {
  width: min(430px, 100%);
  max-width: 100%;
  max-height: min(78dvh, 620px);
  margin: auto auto 0;
  padding: 0;
  overflow: visible;
  color: #352b24;
  background: transparent;
  border: 0;
}

.creator-settings-dialog::backdrop {
  background: rgba(54, 39, 28, 0.36);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.creator-settings-dialog form {
  display: grid;
  gap: 16px;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  background: #fffdf9;
  border: 1px solid rgba(224, 205, 184, 0.72);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -18px 54px rgba(63, 42, 25, 0.18);
}

.creator-settings-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.creator-settings-dialog header > div {
  display: grid;
  gap: 2px;
}

.creator-settings-dialog header span {
  color: #a65417;
  font-size: 11px;
  font-weight: 760;
}

.creator-settings-dialog h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 840;
  letter-spacing: -0.02em;
}

.creator-settings-dialog header button {
  min-width: 60px;
  min-height: 44px;
  padding-inline: 14px;
  color: #735d4c;
  background: #f7efe6;
  border: 1px solid rgba(216, 194, 170, 0.7);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.creator-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.creator-settings-fields label {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 13px;
  background: #fff8f0;
  border: 1px solid rgba(220, 197, 171, 0.68);
  border-radius: 18px;
}

.creator-settings-fields label > span {
  color: #6f5f52;
  font-size: 12px;
  font-weight: 700;
}

.creator-settings-fields select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  color: #382f28;
  background: #fffdf9;
  border: 1px solid rgba(209, 184, 157, 0.74);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 650;
}

.creator-settings-dialog form > p {
  margin: -3px 0 0;
  color: #81766d;
  font-size: 11.5px;
  line-height: 1.45;
}

.creator-settings-apply {
  width: 100%;
  min-height: 54px;
  color: #fffaf4;
  background: linear-gradient(135deg, #b64d0c, #943b08);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(153, 60, 7, 0.18);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 340px) {
  .creator-settings-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .creator-settings-dialog::backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* v163 unified mobile creation workbench */
.creator-hub-header,
.screen-header.creator-header {
  background: rgba(255, 250, 244, 0.96);
  border-bottom: 1px solid rgba(112, 77, 46, 0.08);
}

.creator-hub-content,
.creator-content {
  display: grid;
  gap: 14px;
}

.creator-mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-height: 52px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(218, 193, 164, 0.62);
  border-radius: 999px;
  box-shadow: 0 7px 20px rgba(77, 51, 30, 0.06);
}

.creator-mode-switch button,
.creator-mode-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding-inline: 12px;
  color: #74665b;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.creator-mode-switch [aria-current="page"] {
  color: #fffaf4;
  background: #3d3027;
  box-shadow: 0 7px 16px rgba(61, 48, 39, 0.16);
}

.creator-screen .creator-hero {
  grid-template-columns: minmax(0, 1fr) 92px;
  min-height: 132px;
  padding: 16px 14px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(77, 51, 30, 0.08);
}

.creator-screen .creator-hero-image {
  background: linear-gradient(145deg, #f7fcf9, #e7f6ee);
}

.creator-screen .creator-hero-video {
  background: linear-gradient(145deg, #fffaf4, #f3e2d0);
}

.creator-screen .creator-hero h2 {
  max-width: 230px;
  margin-top: 7px;
  color: #30261f;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.creator-screen .creator-hero p {
  max-width: 230px;
  margin-top: 7px;
  color: #756b63;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.48;
}

.creator-screen .creator-hero img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(74, 58, 43, 0.12));
}

.creator-screen .creator-panel {
  gap: 13px;
  padding: 17px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(222, 204, 184, 0.6);
  border-radius: 24px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.creator-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.creator-panel-heading > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.creator-panel-heading span,
.creator-preset-group > span {
  color: #aa5b18;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.creator-screen .creator-panel-heading label {
  color: #30261f;
  font-size: 18px;
  font-weight: 820;
  letter-spacing: -0.015em;
  line-height: 1.28;
}

.creator-panel-heading small {
  flex: 0 0 auto;
  color: #8b8178;
  font-size: 11px;
  line-height: 1.3;
}

.creator-screen .creator-panel textarea {
  min-height: 144px;
  padding: 14px 15px;
  color: #372d26;
  background: #fffaf5;
  border-color: rgba(214, 188, 158, 0.72);
  border-radius: 18px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
}

.creator-screen .creator-panel textarea::placeholder {
  color: #9b9188;
}

.creator-preset-group {
  display: grid;
  gap: 8px;
}

.creator-screen .creator-preset-row {
  display: flex;
  gap: 8px;
  margin-inline: -2px;
  padding: 2px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.creator-screen .creator-preset-row::-webkit-scrollbar {
  display: none;
}

.creator-screen .creator-preset-row button {
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 15px;
  color: #76512c;
  background: #fff7ec;
  border-color: rgba(220, 183, 137, 0.58);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.creator-setup-list {
  display: grid;
  gap: 8px;
}

.creator-screen .creator-reference-action,
.creator-screen .creator-settings-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  color: #392f28;
  background: #fffdf9;
  border: 1px solid rgba(219, 198, 176, 0.7);
  border-radius: 19px;
  text-align: left;
}

.creator-setup-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #9b4d12;
  background: #fff0dc;
  border-radius: 50%;
  object-fit: contain;
  padding: 8px;
}

.creator-reference-thumbnail {
  padding: 0;
  object-fit: cover;
  background: #f5eee6;
}

.creator-screen .creator-reference-action > span:nth-child(2),
.creator-screen .creator-settings-summary > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.creator-screen .creator-reference-action strong,
.creator-screen .creator-settings-summary strong {
  color: #392f28;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.3;
}

.creator-screen .creator-reference-action small,
.creator-screen .creator-settings-summary small {
  color: #81766d;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
}

.creator-screen .creator-reference-action b,
.creator-screen .creator-settings-summary b {
  min-width: 48px;
  color: #a65315;
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.creator-screen .creator-settings-summary::before {
  display: none;
  content: none;
}

.creator-screen .creator-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.creator-screen .creator-actions .primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding-inline: 18px;
  color: #fffaf4;
  background: linear-gradient(135deg, #b64d0c, #943b08);
  border-radius: 18px;
  box-shadow: 0 13px 24px rgba(153, 60, 7, 0.2);
  font-size: 15px;
  font-weight: 800;
}

.creator-screen .creator-actions .primary span {
  color: rgba(255, 250, 244, 0.72);
  font-size: 11px;
  font-weight: 550;
}

#toolsScreen .tool-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px;
  gap: 12px;
  min-height: 272px;
  padding: 19px 16px 17px 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 209, 129, 0.34), transparent 30%),
    linear-gradient(145deg, #fff6e7, #ffedd3);
  border: 1px solid rgba(238, 199, 139, 0.54);
  border-radius: 28px;
  box-shadow: 0 14px 34px rgba(104, 68, 33, 0.1);
}

#toolsScreen .tool-spotlight::after {
  display: none;
}

.tool-spotlight-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

#toolsScreen .tool-spotlight-copy > span,
.tool-more-section > header span {
  color: #a75314;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.04em;
}

#toolsScreen .tool-spotlight h2 {
  max-width: 220px;
  margin: 6px 0 0;
  color: #382a20;
  font-size: 24px;
  font-weight: 880;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

#toolsScreen .tool-spotlight p {
  max-width: 225px;
  margin-top: 7px;
  color: #746457;
  font-size: 12.5px;
  font-weight: 520;
  line-height: 1.48;
}

#toolsScreen .tool-flow-steps {
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

#toolsScreen .tool-flow-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

#toolsScreen .tool-flow-steps li > b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #8f4512;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(213, 160, 91, 0.44);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

#toolsScreen .tool-flow-steps li > span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

#toolsScreen .tool-flow-steps strong {
  color: #49372a;
  font-size: 12.5px;
  font-weight: 780;
}

#toolsScreen .tool-flow-steps small {
  color: #897669;
  font-size: 10.5px;
  font-weight: 520;
}

.tool-spotlight-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

#toolsScreen .tool-spotlight-actions button {
  min-width: 0;
  min-height: 44px;
  padding-inline: 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 760;
  white-space: nowrap;
}

#toolsScreen .tool-spotlight-actions button:first-child {
  color: #fffaf4;
  background: #9f430d;
  border-color: #9f430d;
  box-shadow: 0 9px 18px rgba(159, 67, 13, 0.18);
}

#toolsScreen .tool-spotlight-actions button:last-child {
  color: #7c4c22;
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(201, 149, 84, 0.48);
}

.tool-spotlight-visual {
  position: relative;
  z-index: 1;
  align-self: start;
  margin: 3px 0 0;
}

.tool-spotlight-visual img {
  display: block;
  width: 98px;
  height: 142px;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.84);
  border-radius: 22px;
  box-shadow: 0 13px 24px rgba(89, 54, 25, 0.15);
}

.tool-spotlight-visual figcaption {
  position: absolute;
  right: -3px;
  bottom: 9px;
  min-width: 92px;
  padding: 7px 8px;
  color: #79451b;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(225, 179, 116, 0.54);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(77, 51, 30, 0.12);
  font-size: 10px;
  font-weight: 760;
  text-align: center;
  white-space: nowrap;
}

.tool-primary-path {
  display: grid;
  gap: 10px;
}

.tool-primary-path > button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
  min-height: 122px;
  padding: 15px 12px 15px 17px;
  overflow: hidden;
  color: #382d25;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  box-shadow: 0 11px 28px rgba(76, 53, 32, 0.08);
  text-align: left;
}

.tool-primary-path > button:first-child {
  background: linear-gradient(145deg, #f7fcf9, #e9f6ef);
}

.tool-primary-path > button:last-child {
  background: linear-gradient(145deg, #fff8ef, #f1dcc8);
}

.tool-path-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.tool-path-copy small {
  color: #a6581a;
  font-size: 11px;
  font-weight: 760;
}

.tool-path-copy strong {
  color: #342a23;
  font-size: 18px;
  font-weight: 830;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.tool-path-copy b {
  color: #776d65;
  font-size: 11.5px;
  font-weight: 520;
  line-height: 1.4;
}

.tool-primary-path img {
  justify-self: end;
  width: 100px;
  height: 94px;
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(69, 51, 37, 0.12));
}

.tool-more-section {
  display: grid;
  gap: 13px;
  padding: 17px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(222, 204, 184, 0.6);
  border-radius: 26px;
  box-shadow: 0 12px 30px rgba(77, 51, 30, 0.07);
}

.tool-more-section > header {
  display: grid;
  gap: 4px;
}

.tool-more-section > header h2 {
  margin: 1px 0 0;
  color: #352b24;
  font-size: 20px;
  font-weight: 830;
  letter-spacing: -0.018em;
}

.tool-more-section > header p {
  margin: 2px 0 0;
  color: #81766e;
  font-size: 11.5px;
  line-height: 1.45;
}

#toolsScreen .tool-more-section .tool-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

#toolsScreen .tool-more-section .tool-list > button,
#toolsScreen .tool-more-section .tool-list > a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  min-height: 70px;
  height: auto;
  padding: 10px 12px;
  overflow: visible;
  color: #3c3129;
  background: #fffaf5;
  border: 1px solid rgba(222, 203, 182, 0.64);
  border-radius: 20px;
  box-shadow: none;
  text-align: left;
}

#toolsScreen .tool-more-section .tool-list > button::after,
#toolsScreen .tool-more-section .tool-list > a::after {
  display: none;
}

#toolsScreen .tool-more-section .tool-list > button > img,
#toolsScreen .tool-more-section .tool-list > a > img {
  grid-area: auto;
  align-self: center;
  width: 42px;
  height: 42px;
  padding: 8px;
  object-fit: contain;
  background: #fff1df;
  border-radius: 50%;
  box-shadow: none;
}

#toolsScreen .tool-more-section .tool-list > button > span,
#toolsScreen .tool-more-section .tool-list > a > span {
  display: grid;
  grid-area: auto;
  align-self: center;
  min-width: 0;
  max-width: none;
  margin: 0;
  gap: 3px;
  color: inherit;
  white-space: normal;
}

#toolsScreen .tool-more-section .tool-list strong {
  grid-area: auto;
  align-self: auto;
  margin: 0;
  color: #3a3028;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.25;
}

#toolsScreen .tool-more-section .tool-list small {
  color: #81766e;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

#toolsScreen .tool-more-section .tool-list > button > b,
#toolsScreen .tool-more-section .tool-list > a > b {
  color: #a25015;
  font-size: 11.5px;
  font-weight: 760;
}

.tool-desktop-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 4px 2px 0;
  color: #74675d;
  font-size: 11.5px;
}

.tool-desktop-link strong {
  flex: 0 0 auto;
  color: #9b4c14;
  font-size: 11.5px;
  font-weight: 760;
}

/* Preserve pill geometry on narrow phones; shortcuts scroll instead of compressing into squares. */
@media (max-width: 370px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    flex: 0 0 76px;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding-inline: 11px;
    border-radius: 999px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    flex: 0 0 72px;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    padding-inline: 9px;
    border-radius: 999px;
  }
}

@media (max-width: 340px) {
  #toolsScreen .tool-spotlight {
    grid-template-columns: minmax(0, 1fr) 82px;
    padding-inline: 15px 12px;
  }

  .tool-spotlight-visual img {
    width: 82px;
    height: 128px;
  }

  .tool-spotlight-visual figcaption {
    right: -2px;
    min-width: 82px;
    font-size: 9.5px;
  }

  #toolsScreen .tool-spotlight-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #toolsScreen .tool-flow-steps small {
    display: none;
  }

  .tool-primary-path > button {
    grid-template-columns: minmax(0, 1fr) 84px;
    padding-left: 15px;
  }

  .tool-primary-path img {
    width: 82px;
    height: 82px;
  }

  .creator-panel-heading {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .creator-screen .creator-actions .primary span {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .creator-hub-header,
  .screen-header.creator-header,
  .creator-mode-switch,
  .creator-screen .creator-panel,
  .tool-more-section {
    background-color: #fffdf9;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 180px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock {
    right: env(safe-area-inset-right);
    left: env(safe-area-inset-left);
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
    padding: 3px;
  }
}

@media (max-width: 340px) and (max-height: 720px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-hero,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-hero {
    padding-bottom: 10px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase,
  .phone-app[data-active-screen="assistant"]:not(.has-assistant-reply) #assistantScreen .assistant-showcase,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase {
    margin-top: 7px;
    padding-block: 7px;
  }
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
    margin-inline: -4px;
  }
}

/* Browser text zoom can reduce a phone to a sub-280px CSS viewport. Preserve
   the complete identity and instructions by allowing the card to grow. */
@media (max-width: 280px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-brand-lockup p,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line > span:first-child {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-robot,
  .phone-app[data-active-screen="assistant"].has-assistant-reply #assistantScreen .assistant-showcase-robot {
    width: 100%;
    height: 64px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-identity-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-showcase-copy p {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
  }
}

/* v156 cross-page refinement: keep compact tool cards readable and lower fixed-layer paint cost. */
#toolsScreen .tool-list [data-tool-tone="gold"],
#toolsScreen .tool-list [data-tool-tone="cream"],
#toolsScreen .tool-list [data-tool-tone="template"],
#toolsScreen .tool-list [data-tool-tone="pc"] {
  grid-template-areas:
    "tool-icon tool-title"
    "tool-icon tool-subtitle";
  grid-template-rows: minmax(0, auto) minmax(0, auto);
  row-gap: 2px;
}

#toolsScreen .tool-list [data-tool-tone="gold"] > img,
#toolsScreen .tool-list [data-tool-tone="cream"] > img,
#toolsScreen .tool-list [data-tool-tone="template"] > img,
#toolsScreen .tool-list [data-tool-tone="pc"] > img {
  grid-area: tool-icon;
  align-self: center;
}

#toolsScreen .tool-list [data-tool-tone="gold"] > strong,
#toolsScreen .tool-list [data-tool-tone="cream"] > strong,
#toolsScreen .tool-list [data-tool-tone="template"] > strong,
#toolsScreen .tool-list [data-tool-tone="pc"] > strong {
  grid-area: tool-title;
  align-self: end;
  min-width: 0;
}

#toolsScreen .tool-list [data-tool-tone="gold"] > span,
#toolsScreen .tool-list [data-tool-tone="cream"] > span,
#toolsScreen .tool-list [data-tool-tone="template"] > span,
#toolsScreen .tool-list [data-tool-tone="pc"] > span {
  grid-area: tool-subtitle;
  align-self: start;
  min-width: 0;
  max-width: none;
  margin-top: 0;
  overflow: visible;
  white-space: normal;
}

.bottom-nav {
  background: rgba(255, 253, 249, 0.96);
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
  backdrop-filter: blur(12px) saturate(1.12);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
  background: rgba(255, 253, 249, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

@media (prefers-reduced-transparency: reduce) {
  .phone-app,
  .phone-app *,
  .phone-app *::before,
  .phone-app *::after,
  .phone-app *::backdrop {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .bottom-nav,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer,
  #homeQuickPromptForm,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-back-home,
  #profileScreen .profile-pet-setup,
  #profileScreen .profile-stat-grid {
    background: #fffdf9;
  }

  .app-screen-home .case-strip strong,
  .phone-app[data-active-screen="works"] #worksScreen .works-feature-actions {
    background: #3d3027;
  }
}

/* Creator pages are focused subflows: the header owns navigation, not the root tab bar. */
.phone-app[data-active-screen="image"] > .bottom-nav,
.phone-app[data-active-screen="video"] > .bottom-nav,
.phone-app[data-active-screen="template-video"] > .bottom-nav,
.phone-app[data-active-screen="tools"] > .bottom-nav {
  display: none;
}

.phone-app[data-active-screen="image"] #imageScreen .creator-content,
.phone-app[data-active-screen="video"] #videoScreen .creator-content,
.phone-app[data-active-screen="template-video"] #templateVideoScreen .template-video-content,
.phone-app[data-active-screen="tools"] #toolsScreen .screen-content {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.template-video-content {
  display: grid;
  gap: 14px;
}

.template-video-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 14px;
  min-height: 132px;
  padding: 17px 16px 17px 18px;
  color: #352b24;
  background: #fff5e7;
  border: 1px solid rgba(223, 186, 137, 0.58);
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(91, 57, 27, 0.08);
}

.template-video-summary > div {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.template-video-summary span {
  color: #b45a14;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.04em;
}

.template-video-summary h2 {
  overflow: hidden;
  color: #30261f;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-video-summary p {
  display: -webkit-box;
  overflow: hidden;
  color: #786d63;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.template-video-summary img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  background: #f1e5d6;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 20px;
  box-shadow: 0 9px 18px rgba(71, 47, 28, 0.12);
}

.template-video-step {
  display: grid;
  gap: 13px;
  padding: 17px;
  background: #fffdf9;
  border: 1px solid rgba(222, 204, 184, 0.7);
  border-radius: 24px;
}

.template-video-step-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.template-video-step-heading > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.template-video-step-heading span {
  color: #aa5b18;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.template-video-step-heading h2 {
  color: #30261f;
  font-size: 18px;
  font-weight: 830;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.template-video-step-heading > b,
.template-video-step-heading > small {
  flex: 0 0 auto;
  max-width: 112px;
  padding: 6px 9px;
  color: #8b520f;
  background: #fff0c8;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
  text-align: center;
}

.template-video-model-control {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: #fffaf4;
  border: 1px solid rgba(216, 194, 172, 0.7);
  border-radius: 16px;
}

.template-video-model-control label {
  display: grid;
  gap: 7px;
}

.template-video-model-control label > span {
  color: #806d5f;
  font-size: 10.5px;
  font-weight: 700;
}

.template-video-model-control select {
  width: 100%;
  min-height: 42px;
  padding: 8px 34px 8px 10px;
  color: #3b3028;
  background-color: #fffdf9;
  border: 1px solid rgba(205, 181, 157, 0.72);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
}

.template-video-model-control select:focus-visible {
  outline: 2px solid rgba(197, 100, 18, 0.46);
  outline-offset: 2px;
}
.template-video-model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-video-model-grid > button {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 126px;
  padding: 13px 10px 11px;
  color: #3a3029;
  background: #fffaf4;
  border: 1px solid rgba(214, 191, 166, 0.72);
  border-radius: 17px;
  text-align: left;
}

.template-video-model-grid > button.is-selected,
.template-video-model-grid > button[aria-checked="true"] {
  background: #fff2cf;
  border-color: #d99224;
  box-shadow: 0 0 0 2px rgba(217, 146, 36, 0.16);
}

.template-video-model-grid > button > span {
  color: #a35616;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.03em;
}

.template-video-model-grid > button > strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 840;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-video-model-grid > button > small {
  color: #7b7067;
  font-size: 10.5px;
  font-weight: 520;
  line-height: 1.38;
}

.template-video-model-grid > button > em {
  justify-self: start;
  margin-top: auto;
  padding: 3px 6px;
  color: #fff8df;
  background: #7e5a18;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 760;
}

.template-video-model-note {
  color: #766b62;
  font-size: 11.5px;
  font-weight: 540;
  line-height: 1.48;
}

.template-video-segment-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-video-segment-list > button {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 60px;
  padding: 10px;
  color: #65574c;
  background: #fff9f1;
  border: 1px solid rgba(216, 194, 172, 0.72);
  border-radius: 15px;
  text-align: left;
}

.template-video-segment-list > button strong {
  font-size: 12px;
  font-weight: 780;
  line-height: 1.25;
}

.template-video-segment-list > button small {
  margin-top: 3px;
  color: #8b7f75;
  font-size: 10px;
  font-weight: 520;
}

.template-video-segment-list > button.is-selected,
.template-video-segment-list > button[aria-current="true"] {
  color: #6f3d0d;
  background: #fff0cb;
  border-color: #d99125;
}

.template-video-editor textarea {
  min-height: 230px !important;
  resize: vertical;
}

.template-video-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.template-video-settings label {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 11px 12px;
  background: #fffaf4;
  border: 1px solid rgba(216, 194, 172, 0.7);
  border-radius: 16px;
}

.template-video-settings label[hidden] {
  display: none;
}

.template-video-settings .template-video-segment-field {
  grid-column: 1 / -1;
}

.template-video-settings label > small {
  color: #8b7f75;
  font-size: 10px;
  font-weight: 540;
  line-height: 1.35;
}

.template-video-settings label > span {
  color: #806d5f;
  font-size: 10.5px;
  font-weight: 700;
}

.template-video-settings select {
  width: 100%;
  min-height: 36px;
  padding: 6px 28px 6px 8px;
  color: #3b3028;
  background-color: #fffdf9;
  border: 1px solid rgba(205, 181, 157, 0.72);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.template-video-reference-control {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.template-video-reference-list[hidden] {
  display: none;
}

.template-video-reference-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.template-video-reference-item {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f7ede2;
  border: 1px solid rgba(205, 181, 157, 0.74);
  border-radius: 13px;
}

.template-video-reference-item > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-video-reference-item > span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  overflow: hidden;
  padding: 4px 6px;
  color: #fffdf8;
  background: rgba(48, 38, 31, 0.72);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-video-reference-item > button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: #fff;
  background: rgba(48, 38, 31, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
}

.template-video-generation {
  scroll-margin-top: 88px;
}

@media (max-width: 360px) {
  .template-video-summary {
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  .template-video-summary img {
    width: 78px;
    height: 78px;
  }

  .template-video-model-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .template-video-model-grid > button {
    min-height: 104px;
  }

  .template-video-segment-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.phone-app[data-active-screen="templates"] #templatesScreen .template-page-tabs {
  padding-inline-end: calc(var(--page-gutter) + 8px);
  scroll-padding-inline: var(--page-gutter);
}

@media (max-width: 360px) {
  #toolsScreen .tool-list [data-tool-tone="blue"]::after,
  #toolsScreen .tool-list [data-tool-tone="purple"]::after,
  #toolsScreen .tool-list [data-tool-tone="pink"]::after,
  #toolsScreen .tool-list [data-tool-tone="green"]::after {
    top: 10px;
    right: 8px;
    bottom: auto;
    width: 58px;
    height: 54px;
    opacity: 0.7;
  }
}

/* v158 composer geometry: unmistakable circles and elongated capability pills. */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
  border-radius: 28px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  gap: 8px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button:not(.assistant-add-reference) {
  flex: 0 0 auto;
  width: auto;
  min-width: 72px;
  height: 44px;
  min-height: 44px;
  padding-inline: 10px;
  border-radius: 22px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
  flex-basis: auto;
  width: auto;
  min-width: 72px;
  border-radius: 22px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > .assistant-add-reference {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  aspect-ratio: 1;
  border-radius: 50%;
}

@media (min-width: 410px) {
  .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 > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    min-width: 76px;
    padding-inline: 12px;
  }
}

@media (min-width: 371px) and (max-width: 379px) {
  .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 > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    min-width: 68px;
    padding-inline: 8px;
  }
}

@media (min-width: 380px) and (max-width: 400px) {
  .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 > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    min-width: 68px;
    padding-inline: 8px;
  }
}

@media (max-width: 370px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    gap: 8px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    flex: 0 0 56px;
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    padding-inline: 5px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    display: inline-flex;
    flex: 0 0 54px;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    padding-inline: 3px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"] img,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] img {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 280px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    justify-content: space-between;
    gap: 8px;
    overflow: visible;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-divider,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"] {
    display: none;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > .assistant-add-reference,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    display: inline-flex;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding-inline: 0;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row > .send-button {
    justify-self: end;
  }
}

/* v164 root-page refinement: stable navigation, honest media readiness and clearer account priority. */
@media (min-width: 281px) {
  .phone-app > .bottom-nav .assistant-nav-button img {
    top: -20px;
    left: 50%;
    width: 48px;
    height: 48px;
    padding: 3px;
    background: #f4eee7;
    border: 3px solid #fff;
    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%);
  }

}

.phone-app > .bottom-nav .assistant-nav-button:not(.is-active) span {
  color: #75675d;
  font-weight: 760;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-open > span {
  top: auto;
  right: 12px;
  bottom: 12px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy,
.phone-app[data-active-screen="works"] #worksScreen .works-showcase-card:has(.works-showcase-favorite) .works-showcase-copy {
  right: 78px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite {
  top: 12px;
  right: 12px;
  bottom: auto;
}

.phone-app[data-active-screen="profile"] #profileScreen .profile-identity-card.is-empty-stats {
  min-height: 200px;
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-card {
    aspect-ratio: 1.46 / 1;
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy,
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-card:has(.works-showcase-favorite) .works-showcase-copy {
    right: 78px;
  }
}

@media (max-width: 280px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 6px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    flex: 0 0 58px;
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    border-radius: 999px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    flex: 0 0 54px;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    border-radius: 999px;
  }
}

@media (max-width: 374px) {
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-card {
    aspect-ratio: 1.48 / 1;
  }
}

/* Current profile and composer geometry. Keep this as the single final source of truth. */
.phone-app[data-active-screen="profile"] #profileScreen .profile-identity-card.is-empty-stats {
  min-height: 172px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding-inline-end: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 2px 14px;
  scrollbar-width: none;
  white-space: nowrap;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-divider {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > .assistant-add-reference {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  aspect-ratio: 1;
  border-radius: 50%;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row > .send-button {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  aspect-ratio: 1;
  border-radius: 50%;
}

.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 > button[data-assistant-shortcut="quick"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  gap: 5px;
  width: auto;
  min-width: 68px;
  max-width: none;
  height: 44px;
  min-height: 44px;
  padding-inline: 12px;
  border-radius: 999px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
  flex: 0 0 68px;
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  padding-inline: 10px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"],
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
  flex: 0 0 72px;
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding-inline: 8px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"] img,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] img {
  width: 16px;
  height: 16px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button span {
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 370px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    gap: 4px;
    padding-inline-end: 0;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    flex-basis: 62px;
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    padding-inline: 8px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    flex-basis: 66px;
    width: 66px;
    min-width: 66px;
    max-width: 66px;
    padding-inline: 6px;
  }
}

@media (max-width: 340px) and (min-width: 281px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
    margin-inline: 0;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
    gap: 3px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="quick"].is-active {
    flex-basis: 58px;
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    padding-inline: 7px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="image"],
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll > button[data-assistant-shortcut="more"] {
    flex-basis: 61px;
    width: 61px;
    min-width: 61px;
    max-width: 61px;
    padding-inline: 5px;
  }
}

/* v190 · final visual system layer. Keep release-critical refinements in the
   last-loaded stylesheet so earlier legacy rules cannot silently win. */
.phone-app .home-alert-button,
.phone-app .home-avatar-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.phone-app .home-showcase-copy {
  width: 56%;
}

.phone-app .home-showcase-copy h1 {
  max-width: 188px;
}

.phone-app .home-showcase-copy p {
  max-width: 158px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-category-filter {
  padding-inline-end: 28px;
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-card {
  height: 226px;
  aspect-ratio: auto;
  border: 1px solid #ead8c6;
  background: #fffaf3;
  box-shadow: 0 5px 14px rgba(59, 38, 21, 0.08);
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-image {
  width: 100%;
  height: 128px;
  object-fit: cover;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-shade {
  inset: 0 0 auto;
  height: 128px;
  background: linear-gradient(180deg, rgba(24, 15, 9, 0.04), transparent 45%, rgba(24, 15, 9, 0.42));
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-preview {
  inset: 0 0 auto;
  width: 100%;
  height: 128px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-preview > span {
  right: auto;
  bottom: 8px;
  left: 8px;
  min-height: 32px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-card:not(.is-media-ready):not(.is-media-error) > .works-media-fallback {
  top: 64px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy,
.phone-app[data-active-screen="works"] #worksScreen .works-showcase-card:has(.works-showcase-favorite) .works-showcase-copy {
  top: 137px;
  right: 10px;
  bottom: auto;
  left: 10px;
  color: #3b2819;
  text-shadow: none;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy h3 {
  color: #3b2819;
  font-size: 15px;
  font-weight: 700;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy p {
  margin-top: 3px;
  color: #836f5f;
  font-size: 11px;
  font-weight: 500;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite {
  top: 8px;
  right: 8px;
  bottom: auto;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(43, 30, 21, 0.62);
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-favorite img {
  width: 18px;
  height: 18px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy-action {
  top: auto;
  right: auto;
  bottom: 8px;
  left: 8px;
  min-width: 64px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #ead5bf;
  border-radius: 999px;
  color: #6c3c19;
  background: #fff;
  backdrop-filter: none;
  font-size: 11px;
  font-weight: 700;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-open {
  inset: auto 8px 8px auto;
  width: 72px;
  height: 44px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.phone-app[data-active-screen="works"] #worksScreen .works-showcase-open > span {
  position: static;
  display: inline-flex;
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #7e451b;
  border: 1px solid #7e451b;
  border-radius: 999px;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 11px;
  font-weight: 700;
  opacity: 1;
}

@media (max-width: 374px) {
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-card {
    height: 268px;
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-image,
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-shade,
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-preview {
    height: 170px;
  }

  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-copy,
  .phone-app[data-active-screen="works"] #worksScreen .works-showcase-card:has(.works-showcase-favorite) .works-showcase-copy {
    top: 179px;
  }

  .phone-app .home-showcase-copy {
    width: 58%;
  }

  .phone-app .home-showcase-copy p {
    max-width: 145px;
  }
}
/* v239 mobile action separation gate. */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-scroll {
  gap: 8px;
}

@media (max-width: 374px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-composer-dock .composer {
    grid-template-columns: minmax(0, 1fr) var(--tap-min);
    column-gap: 8px;
    row-gap: 6px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-attachment-chip {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen #promptInput {
    grid-column: 1;
    grid-row: 2;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row {
    display: contents;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-feature-toolbar {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .composer-tools-row > .send-button {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
  }
}
/* v247 assistant inline video controls. */
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel {
  box-sizing: border-box;
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 13px;
  padding: 15px 14px 14px 18px;
  overflow: hidden;
  color: #382b22;
  background: #fffdf9;
  border: 1px solid #e8d5c2;
  border-radius: 20px;
  box-shadow: inset 4px 0 0 #f6b73c, 0 10px 24px rgba(118, 77, 34, 0.08);
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel[hidden] {
  display: none;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  gap: 10px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head > div {
  min-width: 0;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head span {
  display: block;
  color: #a65d18;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head h2 {
  margin: 3px 0 0;
  color: #32251d;
  font-size: 18px;
  font-weight: 820;
  letter-spacing: -0.02em;
  line-height: 1.32;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head > strong {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 5px 9px;
  color: #7b490d;
  background: #fff0c8;
  border: 1px solid #edcf91;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-model-field,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings > label {
  box-sizing: border-box;
  display: grid;
  min-width: 0;
  gap: 7px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-model-field > span,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings label > span {
  color: #6f5f52;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.35;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-model-field > select,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings select {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 8px 34px 8px 11px;
  overflow: hidden;
  color: #382f28;
  background-color: #fffaf4;
  border: 1px solid #d9bea2;
  border-radius: 12px;
  color-scheme: light;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-model-field > select {
  min-height: 48px;
  background-color: #fff8e8;
  border-color: #dfa647;
  font-size: 13.5px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-model-field > select:focus-visible,
.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings select:focus-visible {
  outline: 3px solid rgba(169, 72, 8, 0.32);
  outline-offset: 2px;
  border-color: #c96b16;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  gap: 9px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings > label {
  padding: 10px;
  background: #fffaf4;
  border: 1px solid #ead9c9;
  border-radius: 14px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings select {
  padding-inline: 9px 28px;
  background-color: #fffdf9;
  font-size: 12px;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-model-note {
  min-width: 0;
  margin: 0;
  padding-top: 11px;
  overflow-wrap: anywhere;
  color: #76665a;
  border-top: 1px solid #efe0d1;
  font-size: 12px;
  font-weight: 520;
  line-height: 1.58;
}

.phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel select:disabled {
  color: #85776d;
  background-color: #f7f0e8;
  cursor: wait;
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel select:not(:disabled):hover {
    border-color: #c98a36;
  }
}

@media (max-width: 340px) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel {
    gap: 11px;
    padding: 13px 10px 12px 14px;
    border-radius: 18px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head {
    gap: 7px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head h2 {
    font-size: 16px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head > strong {
    padding-inline: 7px;
    font-size: 9.5px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings {
    gap: 7px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings > label {
    padding: 8px;
  }

  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings select {
    padding-inline: 7px 24px;
    font-size: 11.5px;
  }
}

@media (forced-colors: active) {
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-settings > label,
  .phone-app[data-active-screen="assistant"] #assistantScreen .assistant-video-panel-head > strong {
    border-color: CanvasText;
    box-shadow: none;
  }
}
