/* Approved concept 3. Only the three entry screens below use this phone layout.
   Existing desktop and tool-editor rules remain untouched. Colors come from theme.js. */
.ml-only, .ml-brand-mark, .ml-bottom-nav { display: none; }

@media (max-width: 767px) {
  .ml-only { display: block; }
  .ml-only *, .ml-header *, .ml-bottom-nav * { box-sizing: border-box; }
  .ml-only { color: var(--color-text-primary); font-family: var(--font-sans); }
  .ml-only :is(h1,h2,h3,p,figure) { margin: 0; }
  .ml-only a { text-decoration: none; color: inherit; }
  .ml-only button, .ml-only summary { font: inherit; cursor: pointer; }
  .ml-only :is(a,button,summary):focus-visible, .ml-bottom-nav a:focus-visible,
  .ml-bottom-nav button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
  .ml-only [hidden] { display: none !important; }
  .ml-only .ml-title { font-size: 34px; line-height: 1.25; font-weight: 800; letter-spacing: -.035em; }
  .ml-only .ml-subtitle { margin-top: 6px; font-size: 17px; line-height: 1.5; color: var(--color-text-secondary); }
  .ml-only .ml-section-title { font-size: 19px; line-height: 1.4; font-weight: 750; letter-spacing: -.02em; }
  .ml-only .ml-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  .ml-only .ml-more { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 12px; color: var(--color-text-secondary); white-space: nowrap; }
  .ml-only .ml-more .material-symbols-outlined { font-size: 17px; }
  .ml-only .ml-primary { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; border: 0; border-radius: 16px; background: var(--color-action-primary); color: var(--color-action-primary-text); font-size: 17px; font-weight: 700; }

  /* Public home: a single clear hero, compact categories, then real case imagery. */
  .landing-page { background: var(--color-surface) !important; }
  .landing-page .hero-cover-sequence, .landing-page #features,
  .landing-page #examples, .landing-page #main > .public-section { display: none; }
  .landing-page .taste-header { inset: 0 0 auto; padding: 0 16px; height: 64px; background: var(--color-surface); }
  .landing-page .taste-nav-frame { height: 64px; }
  .landing-page .taste-brand, .landing-page .taste-nav-pill { border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; padding: 0; }
  .landing-page .taste-nav-pill { flex: 0 0 auto; width: clamp(132px, 40vw, 190px); justify-content: flex-end; gap: 2px; padding: 2px 4px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); box-shadow: var(--shadow-home-nav); }
  .landing-page .taste-brand { gap: 9px; font-size: 17px; font-weight: 750; }
  .landing-page .taste-brand .taste-brand-mark { width: 36px; height: 36px; font-size: 29px; border-radius: 7px; }
  .landing-page .taste-brand-name { display: flex; flex-direction: column; line-height: 1.2; }
  .landing-page .taste-brand-name small { margin-top: 3px; font-size: 8px; color: var(--color-text-secondary); font-weight: 500; letter-spacing: .015em; }
  .landing-page .taste-nav-cta { display: none; }
  .landing-page .taste-menu-toggle { display: inline-flex; width: 44px; height: 44px; border: 0; background: transparent; box-shadow: none; }
  .landing-page .taste-menu-toggle .material-symbols-outlined { font-size: 28px; }
  .landing-page .taste-language { min-width: 64px; min-height: 44px; font-size: 12px; }
  .landing-page .taste-navigation { top: 60px; background: var(--color-surface); }
  .ml-landing { padding: 80px 16px 20px; max-width: 540px; margin: auto; }
  .ml-landing .ml-title span { display: block; }
  .ml-hero-image { width: 100%; aspect-ratio: 2.23; object-fit: cover; border-radius: 12px; margin-top: 14px; }
  .ml-landing .ml-primary { margin-top: 12px; }
  .ml-category-tabs { display: flex; margin: 12px 0 12px; border-bottom: 1px solid var(--color-border); }
  .ml-category-tabs button { flex: 1; min-width: 0; min-height: 44px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 4px; font-size: 14px; color: var(--color-text-secondary); }
  .ml-category-tabs button[aria-selected="true"] { color: var(--color-accent); border-bottom-color: var(--color-accent); font-weight: 700; }
  .ml-quick-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .ml-quick-card { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 8px; min-height: 72px; border: 1px solid var(--color-border); border-radius: 9px; background: var(--color-surface); }
  .ml-quick-card img { flex: 0 0 54px; width: 54px; height: 54px; border-radius: 6px; object-fit: cover; }
  .ml-quick-card > span { min-width: 0; }
  .ml-quick-card strong { display: block; font-size: 14px; line-height: 1.45; font-weight: 700; }
  .ml-quick-card small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 10px; line-height: 1.5; color: var(--color-text-secondary); }
  .ml-landing-cases { margin-top: 14px; }
  .ml-landing-cases .ml-section-heading { margin-bottom: 12px; }
  .ml-case-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .ml-case-card { border: 0; padding: 0; background: transparent; text-align: left; color: var(--color-text-primary); min-width: 0; }
  .ml-case-card img { width: 100%; aspect-ratio: 1.75; border-radius: 8px; object-fit: cover; }
  .ml-case-card span { display: block; margin-top: 5px; font-size: 11px; line-height: 1.5; }
  .landing-page .public-footer { padding: 22px 0 24px; }
  .landing-page .public-footer > .public-container { width: 100%; max-width: 540px; padding-inline: 16px; }
  .landing-page .footer-top { gap: 12px; margin-bottom: 18px; }
  .landing-page .footer-top .public-brand { gap: 8px; }
  .landing-page .footer-top .public-brand strong { font-size: 15px; }
  .landing-page .footer-top .text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; white-space: nowrap; }
  .landing-page .footer-tools.ml-footer-enhanced { display: none; }
  .landing-page .ml-footer-tools { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
  .landing-page .ml-footer-group { scroll-margin-top: 80px; }
  .landing-page .ml-footer-group + .ml-footer-group { border-top: 1px solid var(--color-border); }
  .landing-page .ml-footer-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 14px; font-size: 14px; font-weight: 650; line-height: 1.5; list-style: none; }
  .landing-page .ml-footer-group summary::-webkit-details-marker { display: none; }
  .landing-page .ml-footer-group summary .material-symbols-outlined { font-size: 20px; color: var(--color-text-secondary); }
  .landing-page .ml-footer-group[open] summary .material-symbols-outlined { transform: rotate(180deg); }
  .landing-page .ml-footer-group ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; list-style: none; margin: 0; padding: 0 14px 12px; }
  .landing-page .ml-footer-group a { display: flex; align-items: center; min-height: 44px; padding-block: 6px; color: var(--color-text-secondary); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
  .landing-page .ml-footer-group a:hover { color: var(--color-accent); }
  .landing-page .footer-bottom { gap: 6px; margin-top: 20px; padding-top: 16px; font-size: 10px; line-height: 1.6; }

  /* Header and bottom navigation exist only on home/profile, never tool editors. */
  body:is([data-current-page="home"],[data-current-page="profile"]) { background: var(--color-surface); }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-topbar { height:64px; min-height:64px; border-bottom:0 !important; background:var(--color-surface) !important; box-shadow:none !important; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-mobile-brand { position:relative; padding-left:45px; min-height:36px; justify-content:center; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .ml-brand-mark { display:grid; place-items:center; position:absolute; left:0; top:0; width:36px; height:36px; border-radius:7px; background:var(--color-action-primary); color:var(--color-action-primary-text); font-size:29px; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-mobile-brand-subtitle { order:1; margin:0; font-size:17px; line-height:1.2; color:var(--color-text-primary); }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-mobile-brand-title { order:2; margin-top:3px; font-size:8px; line-height:1.4; color:var(--color-text-secondary); font-weight:500; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-mobile-menu-btn { position:absolute; right:16px; top:10px; width:44px; height:44px; border:0; background:transparent; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-mobile-menu-btn .material-symbols-outlined { font-size:28px; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-topbar-actions { padding-right:48px; }
  body:is([data-current-page="home"],[data-current-page="profile"]) :is(#ls-nav-user,#ls-nav-guest) { display:none !important; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-toggle-group { border:0; background:transparent; padding:0; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .lsp-toggle-group button { min-width:32px; min-height:44px; padding:0 5px !important; font:12px var(--font-sans); background:transparent !important; color:var(--color-text-secondary) !important; }
  body:is([data-current-page="home"],[data-current-page="profile"])[data-lang="cn"] #lang-cn-btn,
  body:is([data-current-page="home"],[data-current-page="profile"])[data-lang="en"] #lang-en-btn { color:var(--color-text-primary) !important; font-weight:750; }
  body:is([data-current-page="home"],[data-current-page="profile"]) #page-content { padding: 80px 16px calc(90px + env(safe-area-inset-bottom, 0px)) !important; background: var(--color-surface); min-height: 100dvh; }
  #page-content .ml-only .ml-title { font-size: 34px; line-height: 1.25; font-weight: 800; }
  #page-content .ml-only .ml-section-title { font-size: 19px; font-weight: 750; }
  body:is([data-current-page="home"],[data-current-page="profile"]) .ml-bottom-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); position: fixed; z-index: 40; inset: auto 0 0; padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--color-surface); border-top: 1px solid var(--color-border); }
  .ml-bottom-nav :is(a,button) { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 52px; gap: 3px; border: 0; background: transparent; color: var(--color-text-secondary); text-decoration: none; font: 12px/1.25 var(--font-sans); cursor: pointer; }
  .ml-bottom-nav .material-symbols-outlined { font-size: 26px; }
  .ml-bottom-nav [aria-current="page"] { color: var(--color-accent); font-weight: 700; }

  /* Workspace: all image tools grouped into compact phone launch tiles. */
  body[data-current-page="home"] :is(.home-heading,.home-sections) { display: none !important; }
  .ml-workspace { max-width: 540px; margin: auto; }
  .ml-workspace .ml-featured { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 78px; margin: 18px 0 12px; padding: 13px 18px; border: 0; border-radius: 10px; background: var(--color-action-primary); color: var(--color-action-primary-text); text-align: left; }
  .ml-workspace .ml-section-heading { position: relative; padding-right: 90px; }
  .ml-workspace .ml-section-heading .ml-more { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
  .ml-featured > .material-symbols-outlined:first-child { display: grid; place-items: center; width: 52px; height: 52px; font-size: 32px; border-radius: 10px; background: var(--color-home-command); }
  .ml-featured > span:nth-child(2) { flex: 1; min-width: 0; }
  #page-content .ml-featured :is(strong,small,span) { color: inherit; }
  .ml-featured strong { display: block; font-size: 20px; line-height: 1.4; }
  .ml-featured small { display: block; font-size: 12px; line-height: 1.5; margin-top: 3px; }
  .ml-workspace .ml-tool-group + .ml-tool-group { margin-top: 20px; }
  #page-content .ml-workspace .ml-tool-group h3 { margin: 0 0 10px; font-size: 15px; line-height: 1.5; font-weight: 650; }
  .ml-tool-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .ml-tool-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 90px; padding: 12px 6px; text-align: center; border: 1px solid var(--color-border); border-radius: 7px; background: var(--color-surface); }
  .ml-tool-grid .material-symbols-outlined { font-size: 31px; }
  .ml-tool-grid strong { font-size: 14px; line-height: 1.4; font-weight: 650; overflow-wrap: anywhere; }
  .ml-workspace > section + section { margin-top: 24px; }
  .ml-video-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .ml-video-card { display: flex; align-items: center; gap: 10px; padding: 7px; min-height: 74px; border: 1px solid var(--color-border); border-radius: 8px; }
  .ml-video-image { position: relative; flex: 0 0 46%; }
  .ml-video-image img { display: block; width: 100%; height: 58px; border-radius: 5px; object-fit: cover; }
  .ml-video-image .material-symbols-outlined { position: absolute; right: 4px; bottom: 4px; padding: 2px; border-radius: 50%; background: var(--color-action-primary); color: var(--color-action-primary-text); font-size: 17px; }
  .ml-video-card strong { font-size: 14px; line-height: 1.4; }
  .ml-rows { border: 1px solid var(--color-border); border-radius: 9px; overflow: hidden; }
  .ml-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 11px 14px; border: 0; background: transparent; width: 100%; text-align: left; }
  .ml-row + .ml-row { border-top: 1px solid var(--color-border); }
  .ml-row > span:nth-child(2) { flex: 1; font-size: 15px; }
  .ml-row > .material-symbols-outlined:first-child { font-size: 24px; }
  .ml-row > .material-symbols-outlined:last-child { font-size: 20px; color: var(--color-text-secondary); }
  .ml-workspace > section:has(.ml-extra) { position: relative; }
  .ml-workspace > section:has(.ml-extra) > h2 { padding-right: 120px; }
  .ml-extra { margin-top: 0; }
  .ml-extra summary { position: absolute; top: -9px; right: 0; min-height: 44px; display: flex; align-items: center; justify-content: flex-end; font-size: 12px; color: var(--color-text-secondary); }
  .ml-extra[open] > div { margin-top: 8px; }

  /* Profile overview reuses the account's role-filtered destinations and real balance. */
  body[data-current-page="profile"] #ls-profile-page { display: block !important; margin: 0 !important; min-height: 0 !important; max-width: 540px; margin-inline: auto !important; }
  #ls-profile-page > aside { display: none !important; }
  #ls-profile-page:not(.ml-profile-detail) > main { display: none !important; }
  #ls-profile-page.ml-profile-detail > .ml-profile-overview { display: none; }
  #ls-profile-page.ml-profile-detail > main { padding: 0 !important; }
  .ml-profile-overview > .ml-title { margin-bottom: 14px; }
  .ml-profile-user { display: flex; align-items: center; gap: 16px; width: 100%; padding: 0; margin-bottom: 20px; border: 0; background: transparent; text-align: left; }
  .ml-avatar { display: grid; place-items: center; flex: 0 0 68px; height: 68px; border-radius: 50%; background: var(--color-surface-art); font-size: 31px; font-weight: 650; }
  .ml-profile-user > span:nth-child(2) { flex: 1; min-width: 0; }
  .ml-profile-user strong { display: block; font-size: 21px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ml-profile-user small { display: block; font-size: 14px; line-height: 1.5; color: var(--color-text-secondary); margin-top: 4px; }
  .ml-profile-user > .material-symbols-outlined { color: var(--color-text-secondary); }
  .ml-credits { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; min-height: 100px; border: 0; border-radius: 11px; background: var(--color-action-primary); color: var(--color-action-primary-text); text-align: left; }
  #page-content .ml-credits span { color: inherit; }
  .ml-credits small { display: block; font-size: 13px; line-height: 1.5; }
  .ml-credits strong { display: block; font-size: 36px; line-height: 1.2; margin-top: 6px; letter-spacing: -.025em; overflow-wrap: anywhere; }
  .ml-credits > span:last-child { display: flex; align-items: center; gap: 5px; font-size: 12px; flex-shrink: 0; }
  .ml-profile-shortcuts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 14px; }
  #ls-profile-page .ml-profile-shortcuts button { display: flex; align-items: center; gap: 14px; min-height: 72px !important; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); text-align: left; color: var(--color-text-primary); }
  .ml-profile-shortcuts .material-symbols-outlined { font-size: 30px; flex-shrink: 0; }
  .ml-profile-shortcuts button > span:last-child { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
  .ml-profile-security { margin-top: 28px; }
  .ml-profile-security .ml-section-title { margin-bottom: 10px; }
  #ls-profile-page .ml-profile-security .ml-row { min-height: 55px !important; }
  .ml-profile-logout { display: block; min-height: 48px; margin: 20px auto 0; padding: 8px 20px; border: 0; color: var(--color-text-secondary); background: transparent; font-size: 14px; }
  .ml-profile-back { align-items: center; gap: 6px; min-height: 44px; margin-bottom: 16px; padding: 0; border: 0; background: transparent; color: var(--color-text-secondary); font: 14px var(--font-sans); cursor: pointer; }
  #ls-profile-page.ml-profile-detail .ml-profile-back { display: flex; }
  body[data-lang="en"] .ml-tool-grid strong { font-size: 12px; }
  body[data-lang="en"] .ml-quick-card strong { font-size: 12px; }
  body[data-lang="en"] .ml-profile-shortcuts button { gap: 8px; padding: 12px; }
  body[data-lang="en"] .ml-profile-shortcuts button > span:last-child { font-size: 13px; }
}
