/* Full application refinement. Native chat scrolling and page-transition shells
   keep their existing geometry; content width is bounded inside the shell. */
html .phone-shell .content:not(.community-chat-page) { box-sizing: border-box; width: 100%; max-width: 1000px; margin-inline: auto; }
html .phone-shell .content > .page-intro { padding: 8px 2px 16px; border: 0; border-radius: 0; background: transparent !important; box-shadow: none; margin-bottom: 0; gap: 12px; }
html .phone-shell .content > .page-intro .eyebrow { display: none; }
html .phone-shell .content > .page-intro h2 { font-size: 21px !important; margin: 0 0 5px; overflow-wrap: anywhere; }
html .phone-shell .content > .page-intro p { margin: 0; font-size: 13px; }
html .phone-shell .content > .page-intro > div { min-width: 0; }
html .phone-shell .content > .page-intro .round-action { flex-shrink: 0; width: 44px !important; height: 44px !important; border-radius: 12px; }

/* The dashboard should expose actual records sooner. */
html .phone-shell .home-redesign .home-hero { min-height: 0; padding: 16px 16px 30px; }
html .phone-shell .home-redesign .home-hero h2 { font-size: 22px !important; }
html .phone-shell .home-hero .hero-add { width: 44px; height: 44px; border-radius: 12px; }
html .phone-shell .metric-strip.home-overview-metrics { margin: -16px 8px 12px; padding-block: 6px; }
html .phone-shell .home-overview-metrics > div { min-height: 46px; }
html .phone-shell .action-panel.care-action-panel.home-module-panel { margin-bottom: 12px; gap: 8px; }
html .phone-shell .action-panel.care-action-panel.home-module-panel > .care-action { min-height: 66px !important; padding: 10px 12px !important; row-gap: 2px !important; }
html .phone-shell .home-redesign .work-tasks { padding: 14px; margin-bottom: 12px; }
html .phone-shell .home-redesign .work-task { padding-block: 9px; }

/* Photo and key measurements belong on the same first screen. */
html .phone-shell .detail-summary-card { position: relative; padding-right: 48px !important; }
html .phone-shell .detail-summary-card .detail-more { min-width: 44px; min-height: 44px; }
html .phone-shell .turtle-detail-hero.detail-photo-card { position: relative; margin-bottom: 12px; }
html .phone-shell .turtle-detail-hero.detail-photo-card > img { width: 100%; height: 180px; max-height: 180px; object-fit: contain; background: var(--ui-raised); }
.detail-photo-hint { position: absolute; right: 10px; bottom: 10px; padding: 4px 8px; border-radius: 8px; background: #17352cd9; color: #fff; font-size: 11px; pointer-events: none; }
html .phone-shell .detail-grid-card { padding: 12px; }
html .phone-shell .detail-grid-card > div { min-width: 0; padding: 10px 12px; }
html .phone-shell .detail-grid-card strong { overflow-wrap: anywhere; }
html .phone-shell .growth-filter-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
html .phone-shell .growth-filter-row > button { min-width: 0; min-height: 44px; padding: 8px 2px; font-size: 12px; }
/* Six operations sections form complete rows rather than a 4+2 or 5+1 split. */
html .phone-shell .operations-page .operations-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 600px) {
  html .phone-shell .operations-page .operations-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
html .phone-shell .growth-history-delete { width: 44px; min-width: 44px; height: 44px; }
.growth-list-status { display: flex; justify-content: space-between; gap: 8px; margin: 12px 2px; color: var(--ui-muted); font-size: 12px; }

/* Publish controls stay prominent without a full-height promotional banner. */
html .phone-shell .community-refined-page .community-invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px 14px 0; margin-bottom: 12px; border-radius: 16px; }
html .phone-shell .community-refined-page .community-invite-copy { grid-column: 1; min-width: 0; }
html .phone-shell .community-refined-page .community-invite-eyebrow { display: none; }
html .phone-shell .community-refined-page .community-invite h2 { margin: 0 0 4px; font-size: 18px; }
html .phone-shell .community-refined-page .community-invite p { font-size: 11px; line-height: 1.6; }
html .phone-shell .community-refined-page .community-invite-publish { grid-column: 2; grid-row: 1; align-self: center; min-height: 44px; padding: 10px 12px; font-size: 12px; border-radius: 12px; }
html .phone-shell .community-refined-page .community-invite-publish > span { display: none; }
html .phone-shell .community-refined-page .community-invite-shortcuts > button { min-height: 44px; justify-content: center; font-size: 11px; }
html .phone-shell .community-refined-page .forum-circle-strip button { min-height: 44px; }
html .phone-shell .community-refined-page .forum-sort-tabs button { min-height: 44px; }

/* Product text gets the same surface and alignment as its photo. */
html .phone-shell .market-grid { gap: 12px; }
html .phone-shell .market-card-wrap { min-width: 0; }
/* Native form controls have wider intrinsic sizes in Mac WebKit. An implicit
   auto grid column lets one control expand every publish card offscreen. */
.market-publish-form {
  grid-template-columns: minmax(0, 1fr);
  width: 100%; min-width: 0; max-width: 100%;
}
.market-publish-form > *,
.market-publish-form :is(.market-fields-card, .market-field-group, label, .market-form-two, .market-price-input, .market-species-picker, .market-title-templates) {
  min-width: 0; max-width: 100%;
}
.market-publish-form :is(.market-fields-card, .market-fields-card label, .market-field-group) {
  grid-template-columns: minmax(0, 1fr);
}
.market-publish-form :is(.field, .select, textarea) { min-width: 0; max-width: 100%; }
html .phone-shell .market-card { display: block; width: 100%; border: 1px solid var(--ui-line); border-radius: 14px !important; padding: 0; overflow: hidden; }
html .phone-shell .market-card-photo { border-radius: 0; }
html .phone-shell .market-card-body { padding: 10px 8px; }
html .phone-shell .market-card-body > strong { font-size: 14px; line-height: 1.5; }
html .phone-shell .market-stage-tabs > button { min-height: 44px; }
html .phone-shell .market-card-seller { gap: 4px; flex-wrap: wrap; }
html .phone-shell .market-card-seller > em { margin-left: 0; }

/* Inbox boundaries remain compatible with horizontal conversation actions. */
html .phone-shell .message-page { padding: 14px 14px 24px !important; }
html .phone-shell .message-activity-summary .message-activity-row { min-height: 76px; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
html .phone-shell .message-activity-row .message-activity-icon { width: 40px; height: 40px; }
html .phone-shell .message-activity-icon svg { width: 24px; height: 24px; }
html .phone-shell .message-list-heading { margin: 12px 0 8px; padding: 0 2px; min-height: 24px; background: transparent !important; }
html .phone-shell .message-friend-list { border: 1px solid var(--ui-line); border-radius: 16px; overflow: hidden; }

/* Frequent personal actions precede appearance settings. */
html .phone-shell .fresh-profile h2 { font-size: 22px !important; overflow-wrap: anywhere; }
html .phone-shell .space-profile-card { padding-block: 20px; }
html .phone-shell .account-brief > div { padding-block: 10px; }
html .phone-shell .space-social-links { padding: 10px 4px; }
html .phone-shell .mine-row { min-height: 54px; padding-block: 12px; }
html .phone-shell .theme-row .theme-dot { min-height: 44px; }
html .phone-shell .settings-card details > summary { min-height: 44px; padding-block: 10px; }
html .phone-shell .report-profit-card { padding: 18px; background: var(--ui-primary-fill) !important; color: #fff !important; }
html .phone-shell .report-profit-card.negative { background: #964856 !important; }
html .phone-shell .report-profit-card :is(strong, span, b, small) { color: inherit !important; }
html .phone-shell .report-profit-card::after, html .phone-shell .report-intro::after { display: none; }
html[data-theme-color="dark"] .phone-shell .report-profit-card { background: var(--ui-surface) !important; color: var(--ui-text) !important; }
html .phone-shell .report-profit-copy > strong { font-size: clamp(24px, 6vw, 32px); overflow-wrap: anywhere; }
html .phone-shell .report-section-head { flex-wrap: wrap; gap: 8px; }
html .phone-shell .species-search-card { padding: 12px; }
html .phone-shell .content.species-page { padding-right: 56px !important; }
html .phone-shell .species-alpha-nav { top: 90px; bottom: auto; transform: none; align-content: start; grid-auto-rows: 44px; right: max(10px, calc((100vw - 1000px) / 2 + 10px)); width: 32px; max-height: calc(100dvh - 110px); overflow-y: auto; overflow-x: hidden; }
html .phone-shell .species-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 48px; gap: 10px; align-items: center; padding: 12px; min-height: 80px; }
html .phone-shell .species-row > img { grid-column: 1; grid-row: 1; width: 54px; height: 54px; }
html .phone-shell .species-row > div { grid-column: 2; grid-row: 1; min-width: 0; }
html .phone-shell .species-row strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
html .phone-shell .species-row .species-add { grid-column: 3; grid-row: 1; width: 48px; min-height: 44px; padding: 8px 2px; font-size: 12px; }
html .phone-shell .species-alpha-nav a, html .phone-shell .species-alpha-nav button { min-width: 32px; min-height: 44px; }
html .phone-shell .community-search-shell button[data-community-search-clear] { width: 44px; height: 44px; }
/* Search focus follows the rounded control boundary rather than the inner input. */
html :is(.phone-shell, .modal-overlay, .archive-directory-dialog, [role="dialog"]) :is(.market-search-wrap, .community-search-shell > label, .directory-search, .market-species-search-row):focus-within,
html .phone-shell .content :is(input.fresh-search, input[type="search"]):focus {
  border-color: #1f7961 !important; outline: none !important; box-shadow: inset 0 0 0 1px #1f7961 !important;
}
html :is(.phone-shell, .modal-overlay, .archive-directory-dialog, [role="dialog"]) :is(.market-search-wrap, .community-search-shell > label, .directory-search, .market-species-search-row) input[type="search"]:focus {
  border: 0 !important; outline: none !important; box-shadow: none !important; background: transparent !important;
}
html[data-theme-color="dark"] .phone-shell .content :is(input.fresh-search, input[type="search"]):focus,
html[data-theme-color="dark"] :is(.phone-shell, .modal-overlay, .archive-directory-dialog, [role="dialog"]) :is(.market-search-wrap, .community-search-shell > label, .directory-search, .market-species-search-row):focus-within {
  border-color: #6bd0aa !important; box-shadow: inset 0 0 0 1px #6bd0aa !important;
}
html[data-theme-color="dark"] :is(.phone-shell, .modal-overlay, .archive-directory-dialog, [role="dialog"]) :is(.market-search-wrap, .community-search-shell > label, .directory-search, .market-species-search-row) input[type="search"]:focus { box-shadow: none !important; }
html .phone-shell .team-space .ts-panel { padding: 16px; margin-block: 12px; }
html .phone-shell .team-space .ts-workhero { padding: 18px; }
html .phone-shell .team-space .ts-tabs { gap: 6px; margin-bottom: 14px; }
html .phone-shell .team-space .ts-tabs > button { min-height: 56px; }
@media (min-width: 700px) {
  html .phone-shell .turtle-detail-hero.detail-photo-card > img { height: 240px; max-height: 240px; }
  html .phone-shell .market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  html .phone-shell .community-refined-page .community-invite { grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; padding-inline: 12px; }
  html .phone-shell .community-refined-page .community-invite h2 { font-size: 16px; }
  html .phone-shell .community-refined-page .community-invite-publish { padding-inline: 6px; font-size: 11px; }
  html .phone-shell .community-refined-page .community-invite-publish svg { display: none; }
}

/* Keep known single-archive gender beside the species even on narrow screens. */
.turtle-row-species > .turtle-individual-species {
  display: flex;
  align-items: baseline;
  flex: 1;
  gap: 4px;
}
.turtle-individual-species > .turtle-species-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.turtle-individual-species > .turtle-gender {
  flex-shrink: 0;
  white-space: nowrap;
}

/* A local illustration is the final fallback, never a fabricated record photo. */
.breeding-cover {
  --breed-cover-bg: #eaf4ee;
  --breed-cover-ink: #397d67;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 11px;
  color: var(--breed-cover-ink);
  background: var(--breed-cover-bg);
  isolation: isolate;
}
.breeding-cover-art { display: block; width: 100%; height: 100%; }
.breeding-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: inherit; object-fit: cover; }
.breeding-row .breeding-cover { width: 54px; height: 54px; }
.breeding-row .breeding-cover, .breeding-photo-box > .breeding-cover, .breeding-history-snapshot .breeding-cover {
  color: var(--breed-cover-ink); background: var(--breed-cover-bg);
}
.breeding-row .breeding-cover > img { width: 100%; height: 100%; }
.breeding-cover .breeding-cover-source {
  position: absolute; right: 2px; bottom: 2px; z-index: 1;
  padding: 0 3px; border-radius: 4px;
  background: #fffef8; color: #285c48;
  font-size: 9px; font-weight: 600; font-style: normal;
  line-height: 15px; white-space: nowrap;
  box-shadow: 0 1px 3px #152f2526;
}
html[data-theme-color="dark"] .breeding-cover {
  --breed-cover-bg: #263b33;
  --breed-cover-ink: #a6d1b8;
  color: #a6d1b8; background: #263b33;
}
html[data-theme-color="dark"] .breeding-history-snapshot .breeding-cover { color: var(--breed-cover-ink); background: var(--breed-cover-bg); }
html[data-theme-color="dark"] .breeding-cover .breeding-cover-source { color: #c8ead4; background: #203a2f; }

/* One quiet visual language for missing media and helpful empty states. */
.placeholder-art { display: block; width: 100%; height: 100%; flex: 0 0 auto; }
.visual-avatar { overflow: hidden; background: #e8efdf; }
.visual-avatar > .placeholder-art { width: 92%; height: 92%; margin: auto; }
.turtle-pool-mark > .placeholder-art { width: 88%; height: 88%; }
.ledger-thumb-placeholder > .placeholder-art { width: 86%; height: 86%; }
.photo-uploader > .visual-photo-placeholder {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 64px; height: 64px; overflow: hidden; border-radius: 12px;
  background: #edf2e7;
}
.visual-photo-placeholder > .placeholder-art { width: 88%; height: 88%; }
html .phone-shell .visual-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; width: 100%; gap: 10px; padding: 24px 16px;
}
html .phone-shell .visual-empty > .visual-empty-art {
  display: block; width: 84px; height: 84px; flex: 0 0 auto;
  margin: 0 0 2px; padding: 8px; border-radius: 26px;
  background: #edf2e7;
}
.visual-empty-art > img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 16px; }
html .phone-shell .visual-empty > p { max-width: 320px; overflow-wrap: anywhere; }
.visual-empty > button { max-width: 100%; white-space: normal; }
html[data-theme-color="dark"] .visual-avatar,
html[data-theme-color="dark"] .visual-photo-placeholder,
html[data-theme-color="dark"] .visual-empty > .visual-empty-art { background: #304238; }
/* Community photos share the card surface, with single images aligned left. */
html.community-mobile-ui #app .community-page .forum-thread-media,
html.community-mobile-ui #app .community-page .forum-thread-media .community-media-gallery,
html.community-mobile-ui #app .community-page .forum-thread-media .community-feed-media-cell,
html.community-mobile-ui #app .community-page .forum-thread-media .community-feed-media-button:not(.is-video),
html.community-mobile-ui #app .web-community-detail .community-detail-card.is-single-image .community-detail-media-gallery,
html.community-mobile-ui #app .web-community-detail .community-detail-card.is-single-image .community-detail-media-button:not(.is-video) {
  background: transparent !important;
}
html.community-mobile-ui #app .community-page .forum-thread-media.is-single > .community-feed-media-button:not(.is-video),
html.community-mobile-ui #app .web-community-detail .community-detail-card.is-single-image .community-detail-media-button:not(.is-video) {
  justify-content: flex-start !important; padding: 0 !important; border-radius: 0 !important;
}
html.community-mobile-ui #app .community-page .forum-thread-media.is-single,
html.community-mobile-ui #app .web-community-detail .community-detail-card.is-single-image .community-detail-media-gallery { border-radius: 0 !important; }
html.community-mobile-ui #app .community-page .forum-thread-media.is-single > .community-feed-media-button:not(.is-video) img.community-media,
html.community-mobile-ui #app .web-community-detail .community-detail-card.is-single-image .community-detail-media-button:not(.is-video) img.community-media {
  margin-inline: 0 !important; object-position: left center !important; border-radius: 0 !important;
}
@media (max-width: 320px) {
  html .phone-shell .visual-empty { padding: 20px 12px; }
  html .phone-shell .visual-empty > .visual-empty-art { width: 72px; height: 72px; padding: 6px; border-radius: 22px; }
}
