/* B1-A 整站外壳样式（对照原型 app/apps/prototype/app-v4/index.html 的 .tabbar/.line-card/.filters/.me-* 移植）。
 * 只管外壳四页（创作 / 作品 / 我的 / 口播剪辑入口）+ 底部 Tab 栏；作业页、上传组件行为一概不碰。
 * BRAND1b: shared production lime brand tokens.
 * 分隔线以上为通用外壳，以下为各页片段。 */

:root {
  --sh-accent: var(--brand);
  --sh-c-clip: var(--brand);
  --sh-c-viral: var(--brand);
  --sh-c-drama: var(--brand);
  --sh-danger: var(--danger);
  --sh-tab-h: calc(58px + env(safe-area-inset-bottom, 0px));
}

/* —— 底部 Tab 栏（固定视口底，安全区内衬） —— */
#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: var(--sh-tab-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
#tabbar[hidden] { display: none !important; }
#tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 0;
  padding: 6px 0 4px;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}
#tabbar button .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#tabbar button[aria-selected="true"] { color: var(--sh-accent); font-weight: 700; }
#tabbar .dot {
  position: absolute;
  top: 6px;
  left: calc(50% + 10px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sh-danger);
  box-shadow: 0 0 0 2px var(--panel);
}
#tabbar .dot[hidden] { display: none !important; }

/* Tab 页给底栏留位（三个 Tab 页 + 口播剪辑入口不显示底栏时由 body.tabbed 控制） */
body.tabbed { padding-bottom: var(--sh-tab-h); }
/* 第 2 轮裁决 9：外壳页把署名（SenseVoice）推到内容最末尾——空列表时贴在 Tab 栏上方，不悬在半屏；
   列表长了就自然排在内容后面（margin-top:auto 在内容超过一屏时归 0）。 */
body.tabbed { display: flex; flex-direction: column; min-height: 100vh; }
body.tabbed > main { width: 100%; min-width: 0; box-sizing: border-box; }
body.tabbed .foot { margin-top: auto; }

/* UI-NAV1: share the same navigation across mobile and desktop shells. */
#tabbar [data-tab="billing"] { display: none; }
.top .brand { color: inherit; text-decoration: none; }
.top .brand:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 4px; }

/* ACCT1: persistent header account entry (desktop + phone) with a Sign out menu. */
.top-account { position: relative; display: flex; align-items: center; }
.top-account[hidden] { display: none !important; }
.account-entry { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.account-entry .account-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--sh-accent); color: var(--bg); font-size: 13px; font-weight: 800;
}
.account-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  display: flex; flex-direction: column; gap: 2px; min-width: 184px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.account-menu[hidden] { display: none !important; }
/* ACCT1: while open, lift the sticky header above page toolbars so the menu stays clickable. */
body:has(.account-menu:not([hidden])) > .top { z-index: 50; }
.account-menu .link {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px;
  color: var(--text); text-align: left; white-space: nowrap;
}
.account-menu .link:hover, .account-menu .link:focus-visible { background: rgba(255, 255, 255, .07); }
.account-menu #logoutBtn { color: var(--sh-danger); }
@media (max-width: 520px) { .account-entry .account-entry-label { display: none; } }
@media (min-width: 1024px), (min-width: 768px) and (max-width: 1023px) and (min-height: 501px) {
  :root { --sh-nav-w: 232px; --sh-header-h: 65px; }
  .top { height: var(--sh-header-h); flex-wrap: nowrap !important; }
  #tabbar {
    top: var(--sh-header-h); right: auto; bottom: 0;
    width: var(--sh-nav-w); height: auto; padding: 20px 12px;
    flex-direction: column; gap: 8px; border-top: 0; border-right: 1px solid var(--line);
  }
  #tabbar button {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start;
    gap: 12px; padding: 12px; min-height: 48px; border-radius: 10px; font-size: 15px;
  }
  #tabbar button[aria-selected="true"] { background: rgba(198, 244, 50, .1); }
  #tabbar [data-tab="billing"] { display: flex; }
  #tabbar .dot { top: 10px; left: 30px; }
  body.tabbed { padding-bottom: 0; }
  body.tabbed main, body.tabbed .top-msg {
    width: calc(100% - var(--sh-nav-w)); max-width: 960px;
    margin-left: max(var(--sh-nav-w), calc((100% + var(--sh-nav-w) - 960px) / 2)); margin-right: 0;
  }
  body.tabbed .foot { margin-left: var(--sh-nav-w); }
}

.checkout-status { margin: 18px 0; padding: 20px; border: 1px solid var(--sh-accent); border-radius: 14px; background: rgba(198, 244, 50, .08); }
.checkout-status h2 { margin: 0 0 8px; font-size: 19px; }
.checkout-status p { margin: 0 0 16px; }
.checkout-status[data-state="credited"] { border-color: var(--ok); background: rgba(90, 209, 160, .08); }
.checkout-status .acts { display: flex; flex-wrap: wrap; gap: 10px; }
.checkout-status .acts a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; color: var(--text); border: 1px solid var(--line); }
.checkout-status .acts a.primary { background: var(--sh-accent); border-color: var(--sh-accent); color: var(--bg); }
.checkout-spinner { display: inline-block; width: 16px; height: 16px; margin-right: 8px; border: 2px solid var(--line); border-top-color: var(--sh-accent); border-radius: 50%; animation: checkout-spin 1s linear infinite; }
@keyframes checkout-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .checkout-spinner { animation: none; } }

/* —— 创作页 —— */
.shell-hello { font-size: 16px; color: var(--text); opacity: .92; margin: 4px 0 14px; }
.shell-sec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 0 10px;
}
.shell-sec h2 { margin: 0; font-size: 17px; }
.shell-sec .more-link { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 14px; text-decoration: none; }

.line-card {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 108px;
  margin-bottom: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: left;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.line-card .pic { width: 92px; flex: none; position: relative; background: #111 center / cover; }
.line-card .pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 50%, var(--panel)); }
.line-card .tx { flex: 1; padding: 14px 14px 14px 10px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.line-card .tx b { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line-card .tx span.desc { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.line-card .go {
  align-self: center;
  margin-right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  font-size: 18px;
  flex: none;
}
.line-card.clip { border-left: 4px solid var(--sh-c-clip); }
.line-card.clip .pic { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); }
.line-card.viral { border-left: 4px solid var(--sh-c-viral); }
.line-card.viral .pic { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); }
.line-card.drama { border-left: 4px solid var(--sh-c-drama); }
.line-card.drama .pic { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); }
.soon-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
/* L2 coming-soon sheet: bottom drawer on small screens, centred panel on large */
.soon-sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
}
.soon-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 60vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  color: var(--text);
}
.soon-sheet h3 { margin: 0 40px 12px 0; font-size: 20px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.soon-sheet p { margin: 0; }
.soon-what { font-size: 15px; line-height: 1.6; }
.soon-bright { margin-top: 10px !important; font-size: 14px; line-height: 1.5; color: var(--sh-accent); font-weight: 600; }
.soon-notify { width: 100%; min-height: 48px; margin-top: 20px; font-size: 16px; border-radius: 12px; }
.soon-notify:disabled { opacity: .7; cursor: default; }
.soon-note { min-height: 20px; margin-top: 10px !important; font-size: 13.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.soon-note[data-state="done"] { color: var(--ok); }
.soon-note[data-state="error"], .soon-note[data-state="login"] { color: var(--sh-danger); }
.soon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
@media (min-width: 700px) {
  .soon-sheet-wrap { align-items: center; }
  .soon-sheet { border-radius: 18px; border-bottom: 1px solid var(--line); max-height: 80vh; }
}

/* 最近作品：横排，复用 mine-item 行式标记（v1 E2E 断言就认它） */
.recent-scroll {
  list-style: none;
  margin: 0 -14px;
  padding: 0 14px 4px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.recent-scroll::-webkit-scrollbar { display: none; }
.recent-scroll li { flex: 0 0 auto; width: min(76vw, 300px); }
.recent-scroll li:last-child .mine-item { border-top: 0; }

/* —— 作品页 —— */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 10px;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.filters button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 700;
}
.ing-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: rgba(198, 244, 50, .16);
  color: var(--sh-accent);
  font-size: 11.5px;
  font-weight: 700;
  margin-right: 6px;
}

/* —— 我的页 —— */
.me-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; }
.me-head .av {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: var(--brand-ink);
  font-size: 26px;
  font-weight: 900;
}
.me-head b { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.me-head small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }

.menu {
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  min-height: 52px;
  font-size: 15px;
}
.menu button:last-child { border-bottom: 0; }
.menu button .t { flex: 1; min-width: 0; }
.menu button .mi {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  flex: none;
  font-weight: 700;
}
.menu button .r { color: var(--muted); font-size: 18px; }
.menu button.danger { color: var(--sh-danger); }
.menu button.danger .mi { color: var(--sh-danger); }

.shell-help {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.shell-help[hidden] { display: none !important; }
.shell-fb { margin-top: 12px; display: grid; gap: 10px; }
.shell-fb textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
.shell-fb-done {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(90, 209, 160, .1);
  border: 1px solid var(--ok);
  color: var(--ok);
  font-size: 14.5px;
}
.shell-fb-done[hidden] { display: none !important; }

/* L3b: in-app legal links (purchase consent / account page / home data notice / footer).
   Reuse the site link token --accent (same colour as the credits page's "back to quote" link)
   instead of hard-coded values: lime has 13.59:1 contrast against --panel
   and 14.75:1 against --bg. A future light theme only needs to swap --accent
   (the legal pages use dark ink in light mode, 18.90:1 on white) and these links follow. */
.legal-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-link:hover { color: var(--text); }
.legal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.menu-links { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 4px 0; }
.menu-links .legal-link { display: inline-flex; align-items: center; min-height: 44px; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; margin-top: 6px; }
.foot-legal .legal-link { display: inline-flex; align-items: center; min-height: 32px; }

/* I18N-1 language controls */
.login { position: relative; padding-top: 3.2rem; }
.login .language-toggle { position: absolute; top: .5rem; right: .75rem; min-height: 44px; }
.language-current { margin-left: auto; font-size: .85em; color: var(--muted, #9ca3af); }
.top .brand { min-width: 0; overflow-wrap: anywhere; }
.menu [data-testid="me-language"] { gap: .5rem; }

/* ---- L7 feedback sheet (editor help panel / Me page / failed job page) ----
 * Body-level overlay (z-index above the editor's own .ed-sheet at 55) so one component serves all three entries.
 * Small screens: bottom drawer; from 700px: centred panel. Uses the shell card tokens. */
.fb-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
}
.fb-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  color: var(--text);
}
.fb-head { display: flex; align-items: flex-start; gap: 10px; }
.fb-head h2 { flex: 1; margin: 0 0 8px; font-size: 19px; }
.fb-x {
  width: 44px;
  height: 44px;
  margin: -8px -6px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.fb-intro { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.fb-job {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.fb-label { display: block; margin: 12px 0 6px; font-size: 13.5px; font-weight: 600; }
.fb-sheet textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 118px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
}
.fb-count { margin: 4px 0 0; text-align: right; font-size: 12px; color: var(--muted); }
.fb-file-row { display: flex; align-items: center; }
.fb-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
}
.fb-file-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
}
.fb-file-thumb[hidden] { display: none; }
.fb-file-x {
  min-height: 44px;
  margin-left: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.fb-file-name { margin: 6px 0 0; font-size: 13px; color: var(--muted); word-break: break-all; }
.fb-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.fb-status { min-height: 20px; margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.fb-status[data-state="done"] { color: var(--ok); font-weight: 600; }
.fb-status[data-state="error"], .fb-status[data-state="login"] { color: var(--sh-danger); }
.fb-actions { display: flex; gap: 10px; margin-top: 12px; }
.fb-actions .btn { flex: 1; min-height: 48px; font-size: 16px; }
.fb-faq { margin: 12px 0 0; text-align: center; font-size: 13.5px; }
.fb-faq a { color: var(--accent); }
.fb-done { font-size: 16px; }
@media (min-width: 700px) {
  .fb-wrap { align-items: center; }
  .fb-sheet { border-radius: 18px; border-bottom: 1px solid var(--line); max-height: 84vh; }
}

/* Account remake flow shares the shell, cards, buttons and credit treatment. */
.clone-user { max-width: 960px; margin: 0 auto; padding-bottom: 32px; }
.clone-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin:20px 0 24px; flex-wrap:wrap; }
.clone-heading h1 { margin:4px 0; font-size:clamp(24px,3vw,34px); }
.clone-eyebrow { margin:0; color:var(--muted); font-size:13px; }
.clone-field { display:grid; gap:12px; margin:24px 0 12px; }
.clone-upload .pick { min-width:0; margin:0; }
.clone-upload .pick input[type=file] { min-height:0; padding:0; border:0; }
.clone-upload .pick:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.clone-upload fieldset { border:1px solid var(--line); border-radius:12px; padding:18px; margin:24px 0; display:grid; gap:12px; }
.clone-upload label { line-height:1.6; }
.clone-upload input[type=checkbox],.clone-upload input[type=radio] { width:18px; height:18px; min-height:0; padding:0; flex:0 0 18px; margin:4px 10px 0 0; accent-color:var(--accent); }
.clone-consent { display:flex; align-items:flex-start; cursor:pointer; }
.clone-portraits { display:flex; gap:10px; }
.clone-portraits img { width:64px; height:80px; object-fit:cover; border-radius:10px; }
.clone-authorization { padding-top:8px; }
.clone-authorization h2,.clone-works h2 { font-size:18px; }
.clone-shots { display:grid; gap:12px; margin:20px 0; }
.clone-shot { display:grid; grid-template-columns:76px 1fr auto; align-items:center; gap:20px; padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.clone-shot img,.clone-thumb { width:76px; height:104px; object-fit:cover; border-radius:8px; background:var(--bg); }
.clone-thumb { display:grid; place-items:center; color:var(--muted); }
.clone-shot h3 { margin:0 0 12px; font-size:16px; }
.clone-shot h3 span { display:block; margin-top:6px; }
.clone-mode { display:inline-block; border:1px solid var(--line); background:var(--bg); border-radius:20px; padding:5px 10px; font-size:12px; }
.clone-quote-footer { display:grid; grid-template-columns:1fr 1fr; gap:32px; position:sticky; bottom:70px; }
.clone-quote-footer dl { margin:0; display:grid; gap:10px; }
.clone-quote-footer dl div { display:flex; justify-content:space-between; gap:16px; }
.clone-quote-footer dt { color:var(--muted); font-size:13px; }
.clone-quote-footer dd { margin:0; font-weight:650; white-space:nowrap; }
.clone-quote-footer .primary,.clone-upload .primary { min-height:48px; width:100%; white-space:normal; }
.clone-work { display:flex; justify-content:space-between; align-items:center; gap:16px; border-bottom:1px solid var(--line); padding:18px 0; }
.clone-work p { margin:5px 0 0; font-size:13px; color:var(--muted); }
.clone-works { margin-top:32px; }
.clone-work strong { overflow-wrap:anywhere; }
.clone-progress { padding:28px; }
.clone-progress .btn,.clone-topup .btn { margin:8px 8px 0 0; }
.clone-progress-track { height:6px; background:var(--bg); border-radius:10px; margin:28px 0; overflow:hidden; }
.clone-progress-track span { display:block; width:35%; height:100%; background:var(--accent); border-radius:10px; }
.clone-receipt { display:flex; flex-wrap:wrap; gap:16px; margin:18px 0; font-size:14px; }
.clone-price-dialog { color:var(--text, #202a31); background:var(--panel, #fff); border:1px solid var(--line); max-width:480px; width:calc(100% - 48px); max-height:calc(100dvh - 48px); box-sizing:border-box; overflow:auto; padding:24px; }
.clone-price-dialog::backdrop { background:rgb(0 0 0 / .65); }
.clone-price-dialog .btn { margin:8px 8px 0 0; }
.clone-user [role=alert] { color:var(--accent); }
.clone-user a { text-decoration:none; }
@media(max-width:600px) {
 .clone-user { padding:0 0 28px; }
 .clone-heading { gap:10px; }
 .clone-shot { gap:12px; padding:12px; grid-template-columns:58px 1fr; }
 .clone-shot img,.clone-thumb { width:58px; height:82px; grid-row:span 2; }
 .clone-shot>strong { grid-column:2; font-size:14px; }
 .clone-quote-footer { position:static; grid-template-columns:1fr; gap:22px; padding:20px; }
 .clone-work { align-items:flex-start; flex-direction:column; gap:8px; }
 .clone-price-dialog { padding:20px; }
}

.clone-customer #new-clone,.clone-customer #back-home,.clone-customer .job-lookup { display:none !important; }
.clone-review-back { display:block; margin:16px; }

.clone-price-dialog a.btn { display:inline-flex; align-items:center; min-height:44px; padding:10px 12px; color:var(--blue, var(--accent)); }

.clone-user a:not(.btn) { color:var(--accent); }

/* DESK2C: expanded work grids; phone portrait keeps its original rows and pixels. */
@media (min-width: 1024px), (min-width: 768px) and (max-width: 1023px) and (min-height: 501px), (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  .recent-scroll, .work-grid, .clip-side .mine-list {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 16px;
    overflow: visible; margin: 0; padding: 0; list-style: none;
  }
  .recent-scroll li, .work-grid li, .clip-side .mine-list li { width: auto; min-width: 0; }
  .recent-scroll .mine-item, .work-grid .mine-item, .clip-side .mine-item {
    display: flex; flex-direction: column; align-items: stretch; gap: 12px; border: 0; padding: 0;
  }
  .recent-scroll .mine-thumb, .work-grid .mine-thumb, .clip-side .mine-thumb {
    width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--bg);
  }
  .recent-scroll .mine-thumb:has(img), .work-grid .mine-thumb:has(img), .clip-side .mine-thumb:has(img),
  .me-overview .mine-thumb:has(img) { height: auto; aspect-ratio: auto; }
  .recent-scroll .mine-thumb img, .work-grid .mine-thumb img, .clip-side .mine-thumb img,
  .me-overview .mine-thumb img { display: block; width: 100%; height: auto; max-width: 100%; max-height: none; object-fit: contain; }
  .recent-scroll .mine-body, .work-grid .mine-body, .clip-side .mine-body { gap: 4px; }
  .mine-body .small { overflow-wrap: anywhere; }
  .work-grid > li:has([data-testid="works-empty"]), .work-grid > [data-testid="works-empty"] { grid-column: 1 / -1; }
}

/* DESK2A: page-level desktop layouts. Mobile rules above remain the source of truth. */
@media (min-width: 1024px), (min-width: 768px) and (max-width: 1023px) and (min-height: 501px) {
  body.tabbed main, body.tabbed .top-msg {
    max-width: 1200px;
    margin-left: max(var(--sh-nav-w), calc((100% + var(--sh-nav-w) - 1200px) / 2));
  }
  body.tabbed > main { width: calc(100% - var(--sh-nav-w)); padding: 28px 28px 40px; }
  body.tabbed .top .mobile-brand { display: none; }
  body.tabbed .top .desktop-brand[hidden] { display: inline !important; }
  .desktop-page-title[hidden] { display: block !important; margin: 0 0 24px; font-size: 26px; }
  .shell-hello { font-size: 26px; font-weight: 700; margin: 0 0 24px; }
  .create-lines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .create-lines .line-card { flex-direction: column; gap: 0; justify-content: flex-start; margin: 0; border-left-width: 1px; }
  .create-lines .pic { width: 100%; height: 140px; }
  .create-lines .pic::after { background: linear-gradient(0deg, rgba(0,0,0,.18), transparent); }
  .create-lines .tx { padding: 20px 20px 24px; justify-content: flex-start; gap: 10px; min-height: 140px; }
  .create-lines .tx b { padding-right: 24px; font-size: 20px; }
  .create-lines .go { position: absolute; right: 12px; top: 154px; margin: 0; }
  .shell-sec { margin-top: 32px; margin-bottom: 16px; }
  .works-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
  .works-toolbar .filters { padding: 0; }
  .works-search[hidden] { display: block !important; width: min(360px, 45%); }
  .credits-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: start; }
  .credits-layout > .card { min-width: 0; padding: 20px; }
  .credits-side[hidden] { display: block !important; }
  .credits-side h2 { font-size: 16px; }
  .credits-side [data-testid="side-balance"] { font-size: 22px; font-weight: 700; color: var(--sh-accent); margin: 12px 0 28px; }
  .credits-side ul { list-style: none; padding: 0; margin: 12px 0 20px; }
  .credits-side li { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .credits-side li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .credits-side a, [data-testid="credits-page"] a { color: var(--accent); }
  .credit-packs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .credit-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .credit-pack { min-width: 0; padding: 12px; display: flex; flex-direction: column; }
  .credit-pack h3 { font-size: 16px; overflow-wrap: anywhere; }
  .credit-pack .credit-price { font-size: 22px; overflow-wrap: anywhere; }
  .credit-pack button { padding: 8px 6px; margin-top: auto; white-space: normal; }
  .bill-scroll table { width: 100%; }
  .me-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .me-left { min-width: 0; display: grid; gap: 20px; }
  .me-overview[hidden] { display: block !important; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
  .me-overview h2 { margin: 0 0 16px; font-size: 18px; }
  .me-overview dl { display: grid; gap: 16px; margin: 0 0 24px; }
  .me-overview dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
  .me-overview dt { color: var(--muted); }
  .me-overview dd { margin: 0; color: var(--sh-accent); font-weight: 700; text-align: right; }
  .me-overview h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
  .me-overview .mine-thumb { width: 84px; height: 112px; aspect-ratio: 3 / 4; background: var(--bg); }
  .me-account { padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
  .me-head { padding: 0 0 24px; }
  .me-settings { min-width: 0; }
  .me-account #billingLink a { color: var(--accent); text-underline-offset: 3px; }
  .me-settings .menu-links { padding: 16px 4px 0; }
  .clip-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .clip-primary, .clip-side { min-width: 0; }
  .clip-primary { padding: 24px; }
  .clip-primary h1 { margin-bottom: 24px; }
  .clip-primary .pick { min-height: 180px; display: flex; flex-direction: column; justify-content: center; }
  .clip-primary .pick-name { overflow-wrap: anywhere; }
  .clip-guide[hidden] { display: block !important; padding: 24px; }
  .clip-guide .lead { font-size: 18px; margin-top: 0; }
  .clip-guide #priceInfo { margin-top: 20px; color: var(--sh-accent); }
  .clip-side .mine { padding: 24px; }
  .clip-side .mine-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 10px; }
  .clip-side .mine-list .small { font-size: 11px; }
}
@media (min-width: 1600px) {
  .recent-scroll, .work-grid, .clip-side .mine-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* DESK2C: tablet portrait shares the desktop shell with a compact icon rail. */
@media (min-width: 768px) and (max-width: 1023px) and (min-height: 501px) {
  :root { --sh-nav-w: 72px; }
  #tabbar { padding: 16px 6px; gap: 8px; }
  #tabbar button { flex-direction: column; justify-content: center; gap: 4px; padding: 10px 3px; min-height: 64px; font-size: 11px; line-height: 1.3; }
  #tabbar button span { max-width: 100%; overflow-wrap: anywhere; }
  #tabbar .dot { top: 7px; left: 36px; }
  body.tabbed main, body.tabbed .top-msg { max-width: none; margin-left: var(--sh-nav-w); }
  body.tabbed > main { padding: 24px 20px 32px; }
  .create-lines { gap: 12px; }
  .create-lines .pic { height: 110px; }
  .create-lines .tx { padding: 16px 12px; min-height: 160px; }
  .create-lines .tx b { font-size: 17px; }
  .create-lines .go { top: 120px; right: 8px; }
  .recent-scroll, .work-grid, .clip-side .mine-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
  .credits-layout, .clip-layout, .me-layout { grid-template-columns: minmax(0, 1fr); }
  .credit-packs, .credit-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .me-settings { margin-top: 4px; }
}

/* Short phone landscape keeps bottom navigation and uses the full content width. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  :root { --sh-tab-h: calc(48px + env(safe-area-inset-bottom, 0px)); }
  body.tabbed .top { height: 44px; padding: 0 16px; flex-wrap: nowrap; }
  body.tabbed .top .link, body.tabbed .header-credits { min-height: 36px; padding-top: 4px; padding-bottom: 4px; }
  #tabbar button { flex-direction: row; gap: 8px; padding: 4px 12px; }
  #tabbar .dot { top: 8px; left: calc(50% - 8px); }
  body.tabbed main, body.tabbed .top-msg { max-width: none; }
  .recent-scroll, .work-grid, .clip-side .mine-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 12px; }
  .credit-packs, .credit-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .credit-pack { min-width: 0; }
  .credit-pack button { white-space: normal; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 767px) {
  .recent-scroll, .work-grid, .clip-side .mine-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .credit-packs, .credit-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* BRAND1b: one outlined bilingual lockup at every shell route. */
.top .brand { display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; }
.brand-logo { display: block; width: 160px; height: 52px; object-fit: contain; flex: 0 1 auto; min-width: 0; }
.top .brand .beta { margin-left: 0; flex-shrink: 0; }
.brand-picture { display: flex; flex: 0 0 auto; }
.brand-name { display: none; }
.login-brand-mark { display: block; margin: 0 auto 16px; }
@media (max-width: 520px) {
  .top { gap: 6px; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { display: inline; font-size: 12px; white-space: nowrap; letter-spacing: 0; }
  .top .brand { gap: 4px; }
}
