/* Mobile polish v2: softer hierarchy, compact secondary actions and stable rhythm. */

body[data-app-surface="mobile"] {
  --mobile-heading-soft: #20344d;
  --mobile-action-soft: #eef5fb;
  --mobile-action-soft-border: #d8e5f0;
}

/* A C-end hierarchy: important without using heavy black display type. */
body[data-app-surface="mobile"] :where(
  .mobile-header strong,
  .mobile-section > header h3,
  .mobile-page-intro h2,
  .mobile-form-card h2,
  .mobile-card-list h3,
  .mobile-task-list b,
  .mobile-message-list header b,
  .mobile-profile-card h2,
  .mobile-settings-list b,
  .mobile-all-apps > summary b,
  .m-prg-capture-sheet > header b,
  .el-dialog--mobile .el-layer__header h2
) {
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

body[data-app-surface="mobile"] :where(
  .mobile-section > header h3,
  .mobile-page-intro h2,
  .mobile-form-card h2,
  .mobile-card-list h3,
  .mobile-task-list b,
  .mobile-message-list header b,
  .mobile-profile-card h2,
  .mobile-settings-list b,
  .mobile-all-apps > summary b,
  .m-prg-capture-sheet > header b,
  .el-dialog--mobile .el-layer__header h2
) {
  color: var(--mobile-heading-soft);
}

body[data-app-surface="mobile"] .mobile-header strong {
  font-size: 16px;
}

body[data-app-surface="mobile"] .mobile-page-intro h2 {
  font-size: 20px;
  line-height: 28px;
}

body[data-app-surface="mobile"] .mobile-section > header h3 {
  font-size: 15px;
  line-height: 22px;
}

/* Project switching is a compact utility, not a second title. */
body[data-app-surface="mobile"] .mobile-header > .mobile-context-switch {
  justify-self: end;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 12px;
  color: #fff;
  background: rgb(255 255 255 / 14%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%);
}

body[data-app-surface="mobile"] .mobile-header > .mobile-context-switch .ui-icon {
  width: 16px;
  height: 16px;
}

/* Workbench spacing and alignment. */
body[data-app-surface="mobile"] .mobile-content[data-page-code="M02"] {
  padding-inline: 12px;
}

body[data-app-surface="mobile"] .mobile-content[data-page-code="M02"] > :where(
  .mobile-field-actions,
  .mobile-task-section,
  .mobile-all-apps
) {
  margin-top: 10px;
}

body[data-app-surface="mobile"] .mobile-project-summary h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}

body[data-app-surface="mobile"] .mobile-field-actions {
  padding: 12px;
}

body[data-app-surface="mobile"] .mobile-field-actions > header {
  min-height: 24px;
  margin-bottom: 8px;
}

body[data-app-surface="mobile"] .mobile-section > header::before {
  flex: 0 0 3px;
  align-self: center;
  height: 20px;
  margin-right: 8px;
}

body[data-app-surface="mobile"] .mobile-task-list > :where(a, button) {
  min-width: 0;
  overflow: hidden;
}

body[data-app-surface="mobile"] .mobile-task-list b {
  font-size: 13px;
  line-height: 19px;
}

body[data-app-surface="mobile"] .mobile-task-list small {
  display: block;
  max-width: 100%;
  font-size: 10.5px;
  line-height: 16px;
}

body[data-app-surface="mobile"] .mobile-all-apps > summary {
  min-height: 52px;
  padding-inline: 12px;
}

body[data-app-surface="mobile"] .mobile-all-apps > summary b {
  font-size: 14px;
}

/* Task cards use a short trailing action instead of a full-width bar. */
body[data-app-surface="mobile"] .mobile-card-list article > button {
  display: flex;
  width: fit-content;
  min-width: 88px;
  min-height: 36px;
  margin: 10px 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--mobile-action-soft-border);
  border-radius: 18px;
  color: var(--mobile-primary);
  font-size: 13px;
  background: var(--mobile-action-soft);
}

/* Personal center keeps the role switch close to the identity it affects. */
body[data-app-surface="mobile"] .mobile-profile-card {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
}

body[data-app-surface="mobile"] .mobile-profile-card > button {
  grid-column: 2;
  justify-self: start;
  width: fit-content;
  min-width: 112px;
  min-height: 34px;
  margin-top: 2px;
  padding: 0 13px;
  border: 1px solid var(--mobile-action-soft-border);
  border-radius: 17px;
  font-size: 12px;
  background: var(--mobile-action-soft);
}

body[data-app-surface="mobile"] .mobile-profile-card h2 {
  font-size: 17px;
  line-height: 24px;
}

body[data-app-surface="mobile"] .mobile-profile-card p {
  overflow: hidden;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-app-surface="mobile"] .mobile-settings-list b {
  font-size: 13.5px;
  line-height: 20px;
}

body[data-app-surface="mobile"] .mobile-settings-list > button > .ui-icon:last-child {
  width: 15px;
  height: 15px;
  color: #718096;
}

/* Message and AI-confirmation titles stay readable without looking like admin-table headers. */
body[data-app-surface="mobile"] .mobile-message-list header b {
  font-size: 13px;
  line-height: 19px;
}

body[data-app-surface="mobile"] .mobile-message-list p {
  margin-top: 3px;
  color: #52657d;
  font-size: 12px;
  line-height: 18px;
}

body[data-app-surface="mobile"] .m-prg-capture-sheet > header b,
body[data-app-surface="mobile"] .el-dialog--mobile .el-layer__header h2 {
  font-size: 16px;
  line-height: 24px;
}

body[data-app-surface="mobile"] .m-prg-capture-sheet .prg-ai-candidates label {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  padding: 11px 12px;
  gap: 8px;
}

body[data-app-surface="mobile"] .m-prg-capture-sheet .prg-ai-candidates span {
  color: #2b3e55;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
}

body[data-app-surface="mobile"] .m-prg-capture-sheet .prg-ai-candidates small {
  margin-top: 4px;
  font-size: 11px;
  line-height: 17px;
}

@media (max-width: 374px) {
  body[data-app-surface="mobile"] .mobile-profile-card > button {
    grid-column: 1 / -1;
    margin-left: 62px;
  }
}
