﻿/* Current second/third-screen overrides restored after PM baseline. */
/* Local V0.4 task interaction overrides.
   Loaded after app.css to avoid the legacy duplicated final-lock blocks. */

.task-v4-card-head {
  position: relative !important;
}

.task-v4-grid .task-overview-card,
.task-v4-grid .task-overview-card:first-child,
.task-v4-grid .task-overview-card:nth-child(n+4) {
  min-height: 108px !important;
  grid-template-columns: 116px minmax(0, 1fr) 82px !important;
}

.task-overview-copy {
  min-height: 76px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.task-overview-copy strong {
  display: block !important;
  width: 100% !important;
  color: #101c21 !important;
  font-size: 19px !important;
  line-height: 1.16 !important;
  font-weight: 950 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  text-align: center !important;
}

.task-overview-meta {
  display: grid !important;
  justify-items: end !important;
  gap: 9px !important;
}

.task-overview-meta span,
.task-overview-meta b {
  display: inline-grid !important;
  place-items: center !important;
  min-width: 68px !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
}

.task-overview-meta span {
  color: #1f7e43 !important;
  background: rgba(240, 247, 233, .95) !important;
}

.task-overview-meta b {
  color: #ef5a2a !important;
  background: rgba(255, 238, 226, .96) !important;
}

.task-info-btn {
  width: auto !important;
  height: auto !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #526b65 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  padding: 0 !important;
}

.task-info-bubble {
  position: absolute !important;
  top: 36px !important;
  right: 0 !important;
  z-index: 20 !important;
  width: min(278px, 76vw) !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(204, 216, 193, .95) !important;
  border-radius: 18px !important;
  color: #334940 !important;
  background: rgba(255, 255, 252, .98) !important;
  box-shadow: 0 14px 32px rgba(74, 91, 72, .14) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  font-weight: 800 !important;
}

.task-info-bubble::before {
  content: "" !important;
  position: absolute !important;
  top: -7px !important;
  right: 28px !important;
  width: 12px !important;
  height: 12px !important;
  border-left: 1px solid rgba(204, 216, 193, .95) !important;
  border-top: 1px solid rgba(204, 216, 193, .95) !important;
  background: rgba(255, 255, 252, .98) !important;
  transform: rotate(45deg) !important;
}

.task-v4-habit-card .task-v4-card-head {
  display: grid !important;
  grid-template-columns: max-content 18px 1fr max-content !important;
  align-items: center !important;
  column-gap: 9px !important;
}

.habit-info-btn {
  margin-left: 0 !important;
  justify-self: start !important;
}

.task-v4-habit-card .task-info-bubble {
  right: auto !important;
  top: 38px !important;
  left: 72px !important;
  width: min(292px, calc(100vw - 128px)) !important;
}

.task-v4-habit-card .task-info-bubble::before {
  right: auto !important;
  left: 116px !important;
}

.task-v4-library-card .task-info-bubble {
  top: 38px !important;
  right: auto !important;
  left: 72px !important;
  width: min(292px, calc(100vw - 128px)) !important;
}

.task-v4-library-card .task-info-bubble::before {
  right: auto !important;
  left: 116px !important;
}

.custom-task-card,
.task-browser-card {
  width: min(92vw, 430px) !important;
  max-height: 86dvh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.custom-task-form {
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: repeat(5, max-content) minmax(18px, max-content) max-content !important;
  gap: 13px !important;
  overflow-y: auto !important;
  padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
  -webkit-overflow-scrolling: touch !important;
}

.custom-task-form label {
  display: grid !important;
  gap: 7px !important;
  color: #3e564f !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  font-weight: 900 !important;
}

.custom-task-form input,
.custom-task-form select,
.custom-task-form textarea {
  width: 100% !important;
  border: 1px solid rgba(205, 216, 198, .95) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 252, .96) !important;
  color: #17282a !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 15px !important;
}

.custom-task-form input,
.custom-task-form select {
  min-height: 46px !important;
  padding: 0 13px !important;
}

.custom-task-form textarea {
  min-height: 104px !important;
  padding: 12px 13px !important;
}

.custom-task-row,
.custom-task-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
}

.custom-task-actions {
  margin-top: 2px !important;
  position: sticky !important;
  bottom: 0 !important;
  padding-top: 10px !important;
  background: linear-gradient(180deg, rgba(255, 251, 242, 0), rgba(255, 251, 242, .98) 34%) !important;
}

.custom-task-actions button {
  min-height: 50px !important;
  border-radius: 999px !important;
}

#customTaskError {
  min-height: 18px !important;
  margin: -4px 0 0 !important;
  color: #b84a2e !important;
  font-weight: 800 !important;
}

.task-browser-body {
  max-height: calc(86dvh - 88px) !important;
  overflow-y: auto !important;
  padding: 2px 2px 10px !important;
  -webkit-overflow-scrolling: touch !important;
}

#taskDetailOverlay .task-detail-card {
  width: min(92vw, 430px) !important;
  max-height: 92dvh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#taskDetailOverlay .task-detail-card #taskDetailBody {
  min-height: 0 !important;
  overflow-y: auto !important;
  padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  -webkit-overflow-scrolling: touch !important;
}

#taskDetailOverlay .task-detail-start-btn {
  position: sticky !important;
  bottom: 0 !important;
  box-shadow: 0 -10px 28px rgba(255, 251, 242, .92) !important;
}

.task-detail-hero {
  max-height: 34dvh !important;
}

#taskDetailOverlay .task-execution-card {
  gap: 7px !important;
}

#taskDetailOverlay .task-execution-hero {
  height: min(14dvh, 120px) !important;
  min-height: 84px !important;
  border-radius: 18px !important;
}

#taskDetailOverlay .task-execution-summary {
  gap: 8px !important;
  font-size: 13px !important;
}

#taskDetailOverlay .task-execution-summary span,
#taskDetailOverlay .task-execution-summary b {
  padding: 5px 9px !important;
}

#taskDetailOverlay .task-execution-timer {
  width: min(34vw, 132px) !important;
  height: min(34vw, 132px) !important;
  font-size: 34px !important;
  box-shadow: 0 10px 24px rgba(74, 111, 73, .11) !important;
}

#taskDetailOverlay .task-execution-progress,
#taskDetailOverlay .task-execution-step {
  display: none !important;
}

#taskDetailOverlay .task-execution-steps {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  counter-reset: execution-step !important;
}

#taskDetailOverlay .task-execution-steps li {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 6px !important;
  min-height: 30px !important;
  padding: 6px 7px !important;
  border-radius: 13px !important;
  color: #496057 !important;
  background: rgba(248, 247, 240, .9) !important;
  font-size: 12px !important;
  line-height: 1.28 !important;
  font-weight: 800 !important;
}

#taskDetailOverlay .task-execution-steps li::before {
  counter-increment: execution-step !important;
  content: counter(execution-step) !important;
  display: grid !important;
  place-items: center !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: #26955a !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

#taskDetailOverlay .task-execution-actions {
  gap: 10px !important;
  margin-top: 0 !important;
}

#taskDetailOverlay .task-execution-actions button {
  min-height: 38px !important;
  font-size: 14px !important;
}

.habit-goal-card {
  width: min(96vw, 460px) !important;
  height: min(88dvh, 760px) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  overflow: hidden !important;
}

.habit-goal-top {
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: 88px 1fr 78px !important;
  align-items: center !important;
  gap: 8px !important;
}

.habit-goal-top strong {
  color: #12342c !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  font-weight: 950 !important;
  text-align: center !important;
}

.habit-goal-top .text-btn {
  justify-self: start !important;
  padding: 0 !important;
  color: #526b65 !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.habit-goal-top .primary-btn {
  min-height: 38px !important;
  border-radius: 999px !important;
  font-size: 14px !important;
}

.habit-goal-list {
  display: grid !important;
  gap: 18px !important;
  overflow-y: auto !important;
  padding: 4px 0 !important;
}

.habit-goal-item {
  display: grid !important;
  gap: 10px !important;
}

.habit-goal-item > span {
  color: #1f3f35 !important;
  font-size: 17px !important;
  font-weight: 950 !important;
}

.habit-goal-item > div {
  display: grid !important;
  grid-template-columns: 48px minmax(72px, 1fr) 42px 48px !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px !important;
  border: 1px solid rgba(205, 216, 198, .95) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 252, .92) !important;
}

.habit-goal-item button {
  width: 44px !important;
  height: 44px !important;
  border: 1px solid rgba(125, 159, 134, .55) !important;
  border-radius: 999px !important;
  color: #176d3b !important;
  background: #f4faef !important;
  font-size: 24px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
}

.habit-goal-item strong {
  color: #0f2520 !important;
  font-size: 24px !important;
  font-weight: 950 !important;
  text-align: center !important;
}

.habit-goal-item em {
  color: #526b65 !important;
  font-style: normal !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.habit-goal-note {
  margin: auto 0 0 !important;
  padding: 14px 16px !important;
  border-radius: 22px !important;
  color: #4f675e !important;
  background: rgba(245, 249, 239, .96) !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  font-weight: 850 !important;
}

.task-browser-group {
  display: grid !important;
  gap: 10px !important;
  margin: 0 0 18px !important;
}

.task-browser-group h3 {
  margin: 0 !important;
  color: #1a3a31 !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: 950 !important;
}

.task-browser-list {
  display: grid !important;
  gap: 10px !important;
}

.task-browser-item {
  width: 100% !important;
  min-height: 86px !important;
  display: grid !important;
  grid-template-columns: 100px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 13px !important;
  padding: 9px !important;
  border: 1px solid rgba(221, 225, 214, .95) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 252, .96) !important;
  box-shadow: none !important;
  text-align: left !important;
}

.task-browser-item img {
  width: 100px !important;
  height: 68px !important;
  border-radius: 16px !important;
  object-fit: cover !important;
  background: #f6f3ea !important;
}

.task-browser-item span {
  min-width: 0 !important;
  display: grid !important;
  gap: 7px !important;
}

.task-browser-item strong {
  color: #111b20 !important;
  font-size: 18px !important;
  line-height: 1.18 !important;
  font-weight: 950 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.task-browser-item small {
  color: #547065 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  font-weight: 850 !important;
}

.task-v4-habit-grid > div {
  padding-inline: 10px !important;
}

.task-v4-habit-grid i {
  width: min(90%, 88px) !important;
  height: 8px !important;
}

.task-v4-habit-grid b {
  font-size: 12px !important;
}

.task-v4-habit-grid strong {
  font-size: 12px !important;
}



/* Keep current shared second/third-screen bottom navigation after importing PM full CSS. */
.bottom-tabs {
  left: 16px !important;
  right: 16px !important;
  bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  width: auto !important;
  height: 72px !important;
  min-height: 72px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 250, .86) !important;
  border: 1px solid rgba(223, 220, 205, .82) !important;
  box-shadow: 0 16px 36px rgba(87, 110, 87, .12) !important;
}
.bottom-tabs button {
  min-width: 0 !important;
  height: 56px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}
.bottom-tabs button.active {
  background: rgba(226, 241, 215, .76) !important;
}
.bottom-tabs button b {
  color: #263743 !important;
  font-weight: 900 !important;
}
.bottom-tabs button.active b {
  color: #128045 !important;
}

/* Exact PM HP meter lock against legacy #hpValue/#hpStatus rules from current app.css. */
.phone-screen[data-active-tab="hp"] .hp-v3-meter-card .hp-v3-ring.hp-ring {
  width: 154px !important;
  height: 154px !important;
  min-width: 154px !important;
  transform: none !important;
}
.phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  position: absolute !important;
  inset: 31px !important;
  z-index: 2 !important;
  display: grid !important;
  grid-template-rows: min-content min-content !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 8px !important;
  transform: none !important;
}
.phone-screen[data-active-tab="hp"] #hpRing #hpValue {
  position: static !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  inset: auto !important;
  transform: none !important;
  color: #123543 !important;
  font-size: 34px !important;
  line-height: 34px !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}
.phone-screen[data-active-tab="hp"] #hpRing:not(.uncalibrated) #hpValue::after {
  content: "/100" !important;
  color: #6f7c83 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  margin-left: 4px !important;
  vertical-align: baseline !important;
}
.phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
  position: static !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  inset: auto !important;
  transform: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #4f765d !important;
  font-size: 12px !important;
  line-height: 12px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}
.phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  left: 50% !important;
  bottom: 16px !important;
  transform: translateX(-50%) !important;
  width: min(314px, calc(100% - 42px)) !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 14px !important;
}

/* Remove the legacy HP ring painted by the old app.css; keep only PM's SVG ring. */
.phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}
.phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring::before,
.phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring::after {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.phone-screen[data-active-tab="hp"] #hpRing .hp-ring-track,
.phone-screen[data-active-tab="hp"] #hpRing .hp-ring-progress {
  fill: none !important;
}


/* Scoped PM first-screen locks restored without importing global PM CSS. */
.phone-screen[data-active-tab="hp"] .hp-ring-svg {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  display: block;
  overflow: visible;
  z-index: 0;
}

.phone-screen[data-active-tab="hp"] .hp-ring-track,
.phone-screen[data-active-tab="hp"] .hp-ring-progress {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transform-origin: 70px 70px;
  transform: rotate(90deg);
}

.phone-screen[data-active-tab="hp"] .hp-ring-track {
  stroke: url("#hpRingTrackGradient");
  stroke-dasharray: 100 100;
  opacity: .92;
}

.phone-screen[data-active-tab="hp"] .hp-ring-progress {
  stroke: url("#hpRingProgressGradient");
  stroke-dasharray: 0 100;
  filter: url("#hpRingSoftGlow");
  transition: stroke-dasharray .55s ease;
}

/* === Final HP AI chat card lock: bind to the actual active tab DOM === */
.hp-v3-page.tab-page.active .hp-ai-card {
  min-height: 190px !important;
  height: 190px !important;
  padding: 12px 16px 12px !important;
  display: grid !important;
  grid-template-rows: 28px 32px 50px 40px !important;
  gap: 5px !important;
  border: 1px solid rgba(231, 226, 214, .86) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 252, .94) !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.hp-v3-page.tab-page.active .hp-ai-title-row {
  display: grid !important;
  grid-template-columns: 42px 1fr !important;
  align-items: center !important;
  column-gap: 10px !important;
  min-height: 28px !important;
}

.hp-v3-page.tab-page.active .hp-ai-title-row h2 {
  margin: 0 !important;
  color: #112a32 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
}

.hp-v3-page.tab-page.active .hp-ai-avatar {
  width: 42px !important;
  height: 42px !important;
  object-fit: contain !important;
  display: block !important;
  transform: translateY(6px) !important;
}

.hp-v3-page.tab-page.active .hp-ai-greeting {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: center !important;
  column-gap: 10px !important;
  min-height: 32px !important;
}

.hp-v3-page.tab-page.active .hp-ai-avatar-spacer {
  display: block !important;
  width: 42px !important;
  height: 1px !important;
}

.hp-v3-page.tab-page.active .hp-ai-bubble-art {
  position: relative !important;
  min-width: 0 !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 17px 0 22px !important;
  border-radius: 0 18px 18px 18px !important;
  background: linear-gradient(180deg, rgba(232, 241, 218, .98), rgba(217, 233, 199, .96)) !important;
  box-shadow: none !important;
}

.hp-v3-page.tab-page.active .hp-ai-bubble-art::before {
  content: "" !important;
  position: absolute !important;
  left: -10px !important;
  top: 0 !important;
  width: 18px !important;
  height: 18px !important;
  background: inherit !important;
  clip-path: polygon(100% 0, 0 0, 100% 100%) !important;
}

.hp-v3-page.tab-page.active .hp-ai-bubble-art p {
  margin: 0 !important;
  color: #243c35 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
}

.hp-v3-page.tab-page.active .hp-ai-mini-btn {
  width: 42px !important;
  min-width: 42px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 252, 245, .74) !important;
  border: 1px solid rgba(188, 179, 159, .62) !important;
  color: #6a584d !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

.hp-v3-page.tab-page.active .hp-ai-messages.hidden,
.hp-v3-page.tab-page.active .ai-option-row.hidden {
  display: none !important;
}

.hp-v3-page.tab-page.active .hp-ai-card > .ai-quick-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px 8px !important;
  align-content: start !important;
  margin: 1px 62px 0 52px !important;
  overflow: visible !important;
  min-height: 48px !important;
  height: 48px !important;
}

.hp-v3-page.tab-page.active .hp-ai-card > .ai-quick-row button {
  min-width: 0 !important;
  min-height: 22px !important;
  height: 22px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(205, 201, 193, .75) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 252, .90) !important;
  color: #24323a !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

.hp-v3-page.tab-page.active .hp-ai-input-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 48px !important;
  gap: 8px !important;
  align-items: center !important;
  margin: 0 !important;
}

.hp-v3-page.tab-page.active .hp-ai-input-row input {
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(207, 200, 188, .88) !important;
  background: rgba(255, 255, 252, .86) !important;
  color: #22343a !important;
  font-size: 13px !important;
  box-shadow: none !important;
}

.hp-v3-page.tab-page.active .hp-ai-input-row input::placeholder {
  color: rgba(72, 78, 79, .58) !important;
}

.hp-v3-page.tab-page.active .hp-ai-input-row button {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  display: grid !important;
  place-items: center !important;
}

.hp-v3-page.tab-page.active .hp-ai-input-row button img {
  display: block !important;
  width: 44px !important;
  height: 44px !important;
  object-fit: contain !important;
}

/* === Final HP task card readability pass: use the empty lower space === */
.phone-screen .hp-v3-page.tab-page.active {
  height: calc(100svh - 100px - env(safe-area-inset-bottom)) !important;
  max-height: calc(100svh - 100px - env(safe-area-inset-bottom)) !important;
  overflow: hidden !important;
  gap: 8px !important;
}

.hp-v3-page.tab-page.active .hp-v3-task-card {
  height: 282px !important;
  min-height: 282px !important;
  padding: 10px 12px 12px !important;
  display: grid !important;
  grid-template-rows: 174px 48px 36px !important;
  gap: 4px !important;
  overflow: hidden !important;
}

.hp-v3-page.tab-page.active .hp-v3-task-image {
  width: 100% !important;
  height: 174px !important;
  min-height: 174px !important;
  aspect-ratio: 2 / 1 !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 20px !important;
  display: block !important;
}

.hp-v3-page.tab-page.active .hp-v3-task-copy {
  min-height: 48px !important;
  height: 48px !important;
  padding: 0 4px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  column-gap: 8px !important;
}

.hp-v3-page.tab-page.active .hp-v3-task-copy h2 {
  font-size: 22px !important;
  line-height: 1.05 !important;
  margin: 0 0 4px !important;
}

.hp-v3-page.tab-page.active .hp-v3-task-copy p {
  font-size: 12px !important;
  line-height: 1.18 !important;
  margin: 0 !important;
}

.hp-v3-page.tab-page.active .hp-v3-actions,
.hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  height: 36px !important;
  min-height: 36px !important;
  display: grid !important;
  grid-template-columns: 76px 1fr 76px !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.hp-v3-page.tab-page.active .hp-v3-actions.hidden {
  display: none !important;
}

.hp-v3-page.tab-page.active .hp-v3-actions .primary-btn,
.hp-v3-page.tab-page.active .hp-v3-actions .secondary-btn {
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  box-shadow: none !important;
}

/* === Highest-priority HP task card layout: overrides old 642/154 locks === */
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active {
  height: calc(100svh - 100px - env(safe-area-inset-bottom)) !important;
  max-height: calc(100svh - 100px - env(safe-area-inset-bottom)) !important;
  overflow: hidden !important;
  gap: 8px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
  height: 282px !important;
  min-height: 282px !important;
  max-height: 282px !important;
  flex: 0 0 282px !important;
  padding: 10px 12px 12px !important;
  display: grid !important;
  grid-template-rows: 174px 48px 36px !important;
  gap: 4px !important;
  overflow: hidden !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
  width: 100% !important;
  height: 174px !important;
  min-height: 174px !important;
  aspect-ratio: 2 / 1 !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 20px !important;
  display: block !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
  min-height: 48px !important;
  height: 48px !important;
  padding: 0 4px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  column-gap: 8px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  height: 36px !important;
  min-height: 36px !important;
  display: grid !important;
  grid-template-columns: 76px 1fr 76px !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.hidden {
  display: none !important;
}

/* === HP task card text/badge spacing polish === */
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
  height: 300px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  flex-basis: 300px !important;
  grid-template-rows: 174px 54px 38px !important;
  gap: 7px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
  position: relative !important;
  display: block !important;
  height: 54px !important;
  min-height: 54px !important;
  padding: 0 4px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy > div {
  min-width: 0 !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy h2 {
  margin: 0 0 5px !important;
  font-size: 24px !important;
  line-height: 1.05 !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy p {
  margin: 0 !important;
  width: 100% !important;
  color: #68777f !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy span,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy b {
  position: absolute !important;
  top: 2px !important;
  height: 28px !important;
  min-height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy span {
  right: 78px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy b {
  right: 2px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  height: 38px !important;
  min-height: 38px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .primary-btn,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .secondary-btn {
  height: 38px !important;
  min-height: 38px !important;
}

/* === Final task card asset pass: real image crop, text breathing, image button === */
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
  height: 312px !important;
  min-height: 312px !important;
  max-height: 312px !important;
  flex: 0 0 312px !important;
  flex-basis: 312px !important;
  grid-template-rows: 176px 62px 40px !important;
  gap: 8px !important;
  padding: 10px 12px 12px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
  height: 176px !important;
  min-height: 176px !important;
  width: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #fffdf7 !important;
  border-radius: 20px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
  height: 62px !important;
  min-height: 62px !important;
  padding: 0 4px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy h2 {
  margin: 0 0 10px !important;
  font-size: 23px !important;
  line-height: 1 !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy p {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.18 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy span,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy b {
  top: 0 !important;
  height: 28px !important;
  min-height: 28px !important;
  align-items: center !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  height: 40px !important;
  min-height: 40px !important;
  grid-template-columns: 92px minmax(0, 1fr) 92px !important;
  gap: 8px !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .primary-btn.image-primary-btn {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .primary-btn.image-primary-btn img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .secondary-btn {
  height: 40px !important;
  min-height: 40px !important;
}

/* === Final image buttons and bottom tab icon assets === */
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .image-secondary-btn,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .image-primary-btn {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .image-secondary-btn img,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .image-primary-btn img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .image-secondary-btn img {
  object-fit: fill !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .image-primary-btn img {
  object-fit: contain !important;
}

.bottom-tabs button .tab-icon,
.bottom-tabs button.active .tab-icon,
.bottom-tabs button:active .tab-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

.bottom-tabs button .tab-icon img,
.bottom-tabs button.active .tab-icon img,
.bottom-tabs button:active .tab-icon img {
  display: block !important;
  width: 34px !important;
  height: 34px !important;
  object-fit: contain !important;
}

.bottom-tabs button,
.bottom-tabs button.active,
.bottom-tabs button:active,
.bottom-tabs button .tab-icon,
.bottom-tabs button.active .tab-icon,
.bottom-tabs button:active .tab-icon,
.bottom-tabs button .tab-icon img,
.bottom-tabs button.active .tab-icon img,
.bottom-tabs button:active .tab-icon img {
  transform: none !important;
}

/* === Final control sizing: text side pills + center image CTA + aligned tabs === */
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  grid-template-columns: 76px minmax(0, 1fr) 76px !important;
  align-items: center !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .secondary-btn {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 14px !important;
  border: 1.5px solid rgba(142, 171, 126, 0.62) !important;
  border-radius: 999px !important;
  background: rgba(255, 253, 247, 0.92) !important;
  color: #182a30 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .primary-btn.image-primary-btn {
  height: 42px !important;
  min-height: 42px !important;
  transform: translateY(1px) !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .primary-btn.image-primary-btn img {
  object-fit: contain !important;
}

/* First-screen meter card visual frame: scoped so task/report pages stay unchanged. */
.phone-screen[data-active-tab="hp"] .hp-v3-meter-card {
  position: relative !important;
  height: 230px !important;
  min-height: 230px !important;
  display: grid !important;
  place-items: start center !important;
  padding: 14px 18px 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(236, 231, 218, .70) !important;
  border-radius: 26px !important;
  background: linear-gradient(180deg, rgba(255,255,253,.97), rgba(255,255,248,.92)) !important;
  box-shadow: none !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-meter-card::before {
  content: "" !important;
  position: absolute !important;
  right: 6px !important;
  top: 28px !important;
  width: 178px !important;
  height: 124px !important;
  background: url("/web/assets/hp-v4-branch.webp") center / contain no-repeat !important;
  opacity: .92 !important;
  filter: brightness(1.12) saturate(1.26) contrast(1.08) !important;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.22) 13%, #000 38%, #000 100%) !important;
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.22) 13%, #000 38%, #000 100%) !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-meter-card::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background-image:
    url("/web/assets/hp-card-left-sprinkles.png"),
    url("/web/assets/hp-card-star.svg") !important;
  background-repeat: no-repeat, no-repeat !important;
  background-size: 96px 120px, 26px 26px !important;
  background-position: 42px 42px, calc(100% - 104px) 32px !important;
  opacity: .94 !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-meter-card > * {
  position: relative !important;
  z-index: 1 !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  bottom: 16px !important;
  transform: translateX(-50%) !important;
  width: min(314px, calc(100% - 42px)) !important;
  height: 34px !important;
  min-height: 34px !important;
  display: grid !important;
  grid-template-columns: 1fr 1px 1fr !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(222, 218, 204, .78) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 250, .88) !important;
  box-shadow: none !important;
  z-index: 2 !important;
}


/* Scoped PM chat screen restoration: keeps first/task/report page styles untouched. */

/* PM chat range 6019-6258 */
/* === Functional chat layer: hidden by default, does not alter locked first-screen layout === */
.chat-screen.hidden {
  display: none !important;
}

.chat-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 6%, rgba(214, 232, 173, 0.42), transparent 32%),
    radial-gradient(circle at 92% 12%, rgba(191, 222, 176, 0.32), transparent 28%),
    #fffdf6;
}

.chat-shell {
  width: min(430px, 100vw);
  height: min(932px, 100dvh);
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) auto 76px;
  padding: 14px 18px 16px;
  box-sizing: border-box;
  background:
    linear-gradient(rgba(255, 253, 246, 0.82), rgba(255, 253, 246, 0.88)),
    url("/web/assets/hp-v4-leaf-frame-fast.webp") center top / cover no-repeat;
  overflow: hidden;
}

.chat-head {
  display: grid;
  grid-template-columns: 42px 1fr 58px;
  gap: 10px;
  align-items: center;
  color: #152a30;
}

.chat-back,
.chat-soft-btn,
.chat-send,
.chat-voice {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.chat-back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  color: #173138;
  font-size: 34px;
  line-height: 1;
}

.chat-head strong,
.chat-head span {
  display: block;
}

.chat-head strong {
  font-size: 19px;
  font-weight: 900;
}

.chat-head span {
  margin-top: 3px;
  color: rgba(23, 49, 56, 0.58);
  font-size: 12px;
}

.chat-soft-btn {
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #2d6f57;
  font-size: 13px;
  font-weight: 800;
}

.chat-log {
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 14px;
  scrollbar-width: none;
}

.chat-log::-webkit-scrollbar {
  display: none;
}

.chat-row {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.chat-row.bot {
  grid-template-columns: 46px minmax(0, 1fr);
  justify-items: start;
}

.chat-row.user {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-bubble {
  max-width: 78%;
  padding: 11px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #173138;
}

.chat-row.bot .chat-bubble {
  background: rgba(236, 244, 220, 0.94);
  border-top-left-radius: 8px;
}

.chat-row.user .chat-bubble {
  background: linear-gradient(135deg, #2d9f52, #177157);
  color: #fff;
  border-top-right-radius: 8px;
}

.chat-row.pending .chat-bubble {
  color: rgba(23, 49, 56, 0.58);
}

.chat-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 10px 48px;
}

.chat-option-row button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(142, 171, 126, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #1c6f4f;
  font-weight: 800;
}

.chat-task-card {
  grid-column: 2;
  width: min(260px, 100%);
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(209, 219, 197, 0.72);
}

.chat-task-card strong,
.chat-task-card span,
.chat-task-card small {
  display: block;
}

.chat-task-card strong {
  font-size: 17px;
  color: #173138;
}

.chat-task-card span {
  margin-top: 4px;
  color: #2d8f56;
  font-weight: 900;
}

.chat-task-card small {
  margin-top: 6px;
  color: rgba(23, 49, 56, 0.62);
  line-height: 1.45;
}

.chat-task-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.chat-task-actions button {
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(239, 245, 229, 0.95);
  color: #1f7755;
  font-weight: 800;
}

.chat-task-actions button:first-child {
  background: linear-gradient(135deg, #2f9b4f, #168056);
  color: #fff;
}

.chat-input-bar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 56px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(214, 219, 205, 0.9);
}

.chat-input-bar input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #173138;
  font-size: 14px;
}

.chat-voice,
.chat-send {
  height: 38px;
  border-radius: 999px;
  background: #2c7f5f;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

/* PM chat range 6265-6400 */
/* === Final functional lock: AI task cards must reuse the first-screen recovery card === */
.chat-row:has(.chat-recovery-card) {
  align-items: start !important;
}

.chat-recovery-card.hp-v3-task-card {
  grid-column: 2 !important;
  width: min(324px, 100%) !important;
  height: 256px !important;
  min-height: 256px !important;
  max-height: 256px !important;
  padding: 10px 12px 12px !important;
  display: grid !important;
  grid-template-rows: 124px 56px 40px !important;
  gap: 8px !important;
  border-radius: 24px !important;
  background: rgba(255, 253, 247, .96) !important;
  border: 1px solid rgba(231, 226, 214, .92) !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.chat-recovery-card .hp-v3-task-image {
  width: 100% !important;
  height: 124px !important;
  min-height: 124px !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 18px !important;
  background: #fffdf7 !important;
}

.chat-recovery-card .hp-v3-task-copy {
  position: relative !important;
  height: 56px !important;
  min-height: 56px !important;
  display: block !important;
  padding: 0 4px !important;
}

.chat-recovery-card .hp-v3-task-copy h2 {
  margin: 0 0 7px !important;
  color: #102a32 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
}

.chat-recovery-card .hp-v3-task-copy p {
  margin: 0 !important;
  color: #68777f !important;
  font-size: 12px !important;
  line-height: 1.16 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.chat-recovery-card .hp-v3-task-copy span,
.chat-recovery-card .hp-v3-task-copy b {
  position: absolute !important;
  top: 0 !important;
  height: 28px !important;
  min-height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}

.chat-recovery-card .hp-v3-task-copy span {
  right: 74px !important;
  color: #188247 !important;
  background: rgba(229, 240, 218, .96) !important;
}

.chat-recovery-card .hp-v3-task-copy b {
  right: 0 !important;
  color: #168347 !important;
  background: rgba(229, 240, 218, .96) !important;
}

.chat-recovery-card .hp-v3-actions.chat-recovery-actions,
.chat-recovery-card .hp-v3-actions.compact-panel {
  height: 40px !important;
  min-height: 40px !important;
  display: grid !important;
  grid-template-columns: 74px minmax(0, 1fr) 74px !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.chat-recovery-card .hp-v3-actions .secondary-btn {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  border: 1.5px solid rgba(142, 171, 126, .62) !important;
  border-radius: 999px !important;
  background: rgba(255, 253, 247, .92) !important;
  color: #182a30 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.chat-recovery-card .hp-v3-actions .image-primary-btn {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.chat-recovery-card .hp-v3-actions .image-primary-btn img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.chat-task-card:not(.chat-recovery-card) {
  display: none !important;
}

/* === Functional fix: keep locked visuals, make HP task card and AI task card complete === */

/* PM chat range 6457-6572 */

.chat-recovery-card.hp-v3-task-card {
  width: min(330px, 100%) !important;
  height: 304px !important;
  min-height: 304px !important;
  max-height: 304px !important;
  grid-template-rows: 152px 66px 40px !important;
  gap: 10px !important;
  padding: 12px !important;
}

.chat-recovery-card .hp-v3-task-image {
  height: 152px !important;
  min-height: 152px !important;
  object-fit: cover !important;
}

.chat-recovery-card .hp-v3-task-copy {
  height: 66px !important;
  min-height: 66px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: start !important;
  column-gap: 8px !important;
}

.chat-recovery-card .hp-v3-task-copy > div {
  min-width: 0 !important;
  padding-top: 4px !important;
}

.chat-recovery-card .hp-v3-task-copy p {
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

/* === Short viewport fit: preserve locked visuals while keeping the third HP card visible === */
@media (max-height: 860px) {
  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active {
    gap: 6px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .ai-home-card {
    margin-bottom: 0 !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
    height: 286px !important;
    min-height: 286px !important;
    max-height: 286px !important;
    flex-basis: 286px !important;
    grid-template-rows: 142px 60px 38px !important;
    gap: 8px !important;
    padding: 10px 12px 12px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
    height: 142px !important;
    min-height: 142px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
    height: 60px !important;
    min-height: 60px !important;
  }

  .chat-recovery-card.hp-v3-task-card {
    height: 286px !important;
    min-height: 286px !important;
    max-height: 286px !important;
    grid-template-rows: 142px 60px 38px !important;
    gap: 8px !important;
    padding: 10px 12px 12px !important;
  }

  .chat-recovery-card .hp-v3-task-image {
    height: 142px !important;
    min-height: 142px !important;
  }

  .chat-recovery-card .hp-v3-task-copy {
    height: 60px !important;
    min-height: 60px !important;
  }
}

/* === Chat task-card and in-chat task library fixes === */
.overlay {
  z-index: 1400 !important;
}

.chat-recovery-card .hp-v3-actions.chat-recovery-actions,
.chat-recovery-card .hp-v3-actions.compact-panel {
  grid-template-columns: 76px minmax(0, 1fr) 76px !important;
  align-items: center !important;
}

.chat-recovery-card .hp-v3-actions .secondary-btn {
  height: 34px !important;
  min-height: 34px !important;
  align-self: center !important;
}

.chat-recovery-card .hp-v3-actions .image-primary-btn {
  height: 34px !important;
  min-height: 34px !important;
  overflow: visible !important;
  align-self: center !important;
}

.chat-recovery-card .hp-v3-actions .image-primary-btn img {
  width: 124% !important;
  height: 124% !important;
  margin: -4px 0 0 -12% !important;
  object-fit: contain !important;
}

/* PM chat range 6721-6770 */
/* === Chat-only fit pass: do not touch first-screen task card controls === */
.chat-screen .chat-input-bar {
  grid-template-columns: 42px minmax(0, 1fr) 50px !important;
  gap: 7px !important;
  height: 58px !important;
  min-height: 58px !important;
  max-height: 58px !important;
  padding: 7px 8px !important;
  border-radius: 999px !important;
  box-sizing: border-box !important;
}

.chat-screen .chat-input-bar input {
  font-size: 13px !important;
}

.chat-screen .chat-voice,
.chat-screen .chat-send {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  font-size: 12px !important;
}

.chat-screen .chat-recovery-card .hp-v3-actions.chat-recovery-actions,
.chat-screen .chat-recovery-card .hp-v3-actions.compact-panel {
  grid-template-columns: 66px minmax(116px, 1fr) 66px !important;
  gap: 12px !important;
  height: 34px !important;
  min-height: 34px !important;
}

.chat-screen .chat-recovery-card .hp-v3-actions .secondary-btn {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 8px !important;
  font-size: 14px !important;
  border-radius: 999px !important;
}

.chat-screen .chat-recovery-card .hp-v3-actions .image-primary-btn {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
}

.chat-screen .chat-recovery-card .hp-v3-actions .image-primary-btn img {
  width: 114% !important;
  height: 114% !important;
  margin: -2px 0 0 -7% !important;

}

/* Final chat-only button fit: keep the recovery task CTA inside its card. */
.chat-screen .chat-recovery-card .hp-v3-actions.chat-recovery-actions,
.chat-screen .chat-recovery-card .hp-v3-actions.compact-panel {
  grid-template-columns: 68px minmax(112px, 1fr) 68px !important;
  gap: 9px !important;
}

.chat-screen .chat-recovery-card .hp-v3-actions .image-primary-btn img {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
}

/* Chat input compact height: keep controls balanced while reducing the tall outer pill. */
.chat-screen .chat-input-bar {
  grid-template-columns: 40px minmax(0, 1fr) 48px !important;
  gap: 7px !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 5px 8px !important;
  align-items: center !important;
  overflow: hidden !important;
}

.chat-screen .chat-voice,
.chat-screen .chat-send {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  box-sizing: border-box !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  line-height: 1 !important;
}

/* === Mobile H5 hotfix 20260623: fit first card stack, fast task images, one-screen chat === */
.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active::-webkit-scrollbar {
  display: none !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
  margin-bottom: 0 !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
  width: calc(100% - 8px) !important;
  margin: 0 auto !important;
  object-fit: cover !important;
  object-position: center 42% !important;
  background: #fffdf7 !important;
}

.task-overview-image,
.task-browser-item img {
  content-visibility: auto !important;
  background: #f7f5ed !important;
}

.chat-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: block !important;
  place-items: initial !important;
  overscroll-behavior: contain !important;
  box-sizing: border-box !important;
}

.chat-screen *,
.chat-screen *::before,
.chat-screen *::after {
  box-sizing: border-box !important;
}

.chat-shell {
  width: min(430px, 100vw) !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-rows: 62px minmax(0, 1fr) auto 48px !important;
  gap: 0 !important;
  padding: 10px 14px calc(8px + env(safe-area-inset-bottom)) !important;
  overflow: hidden !important;
}

.chat-head {
  min-height: 0 !important;
  grid-template-columns: 36px minmax(0, 1fr) 54px !important;
  gap: 8px !important;
  align-items: center !important;
}

.chat-back {
  width: 34px !important;
  height: 34px !important;
  font-size: 30px !important;
}

.chat-head strong {
  font-size: 18px !important;
  line-height: 1.12 !important;
}

.chat-head span {
  font-size: 11px !important;
  margin-top: 2px !important;
}

.chat-soft-btn {
  height: 32px !important;
  min-height: 32px !important;
  font-size: 12px !important;
}

.chat-log {
  min-height: 0 !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 6px 0 10px !important;
  overscroll-behavior: contain !important;
}

.chat-option-row {
  flex: 0 0 auto !important;
  max-height: 78px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 6px 0 6px 46px !important;
}

.chat-screen .chat-input-bar {
  width: 100% !important;
  max-width: 100% !important;
  align-self: end !important;
  grid-template-columns: 42px minmax(0, 1fr) 48px !important;
  gap: 7px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 5px 7px !important;
  border-radius: 999px !important;
  align-items: center !important;
  overflow: hidden !important;
}

.chat-screen .chat-input-bar input {
  height: 34px !important;
  line-height: 34px !important;
  font-size: 13px !important;
}

.chat-screen .chat-voice,
.chat-screen .chat-send {
  width: auto !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  border-radius: 999px !important;
}

@media (max-height: 820px) and (max-width: 520px) {
  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active {
    gap: 7px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
    height: 254px !important;
    min-height: 254px !important;
    max-height: 254px !important;
    flex-basis: 254px !important;
    grid-template-rows: 132px 52px 36px !important;
    gap: 6px !important;
    padding: 9px 12px 11px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
    height: 132px !important;
    min-height: 132px !important;
    border-radius: 18px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
    height: 52px !important;
    min-height: 52px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy h2 {
    font-size: 23px !important;
  }
}

/* Compact WeChat mobile viewport: keep the first-screen recommendation card above the tab bar. */
@media (max-height: 820px) and (max-width: 520px) {
  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active,
  .phone-screen[data-active-tab="task"] .task-v4-page.tab-page.active {
    gap: 5px !important;
    padding-top: 4px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-brand,
  .phone-screen[data-active-tab="task"] .task-v4-brand {
    height: 90px !important;
    min-height: 90px !important;
    flex-basis: 90px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-brand img,
  .phone-screen[data-active-tab="task"] .task-v4-brand img {
    width: 68px !important;
    height: 86px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-brand h1,
  .phone-screen[data-active-tab="task"] .task-v4-brand h1 {
    font-size: 27px !important;
    line-height: 1.08 !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-brand p,
  .phone-screen[data-active-tab="task"] .task-v4-brand p {
    font-size: 14px !important;
    line-height: 1.16 !important;
    margin-top: 3px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-card {
    height: 176px !important;
    min-height: 176px !important;
    max-height: 176px !important;
    padding-top: 8px !important;
    border-radius: 24px !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
    width: 112px !important;
    height: 112px !important;
    margin-top: 0 !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
    transform: translateY(-1px) !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing #hpValue {
    font-size: 40px !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
    font-size: 12px !important;
    bottom: 25px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-leaf-left {
    width: 136px !important;
    height: 106px !important;
    top: 45px !important;
    bottom: auto !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
    min-height: 34px !important;
    height: 34px !important;
    margin-top: 7px !important;
    padding: 0 12px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta span {
    min-height: 28px !important;
    font-size: 13px !important;
    gap: 5px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta img {
    width: 22px !important;
    height: 22px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta b {
    font-size: 17px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card {
    height: 142px !important;
    min-height: 142px !important;
    max-height: 142px !important;
    padding: 9px 14px 10px !important;
    gap: 5px !important;
    border-radius: 24px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-title-row {
    min-height: 28px !important;
    gap: 8px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-title-row h2 {
    font-size: 18px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-avatar,
  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-avatar-spacer {
    width: 34px !important;
    height: 34px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-greeting {
    min-height: 28px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-bubble-art {
    min-height: 28px !important;
    padding: 5px 12px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-bubble-art p {
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .ai-quick-row {
    gap: 4px 7px !important;
    padding-left: 42px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .ai-quick-row button {
    min-height: 22px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row {
    grid-template-columns: minmax(0, 1fr) 40px !important;
    min-height: 34px !important;
    gap: 8px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row input {
    height: 34px !important;
    min-height: 34px !important;
    font-size: 12px !important;
    padding: 0 16px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row button {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
    height: 224px !important;
    min-height: 224px !important;
    max-height: 224px !important;
    flex-basis: 224px !important;
    grid-template-rows: 108px 48px 36px !important;
    gap: 6px !important;
    padding: 8px 12px 10px !important;
    border-radius: 24px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
    height: 108px !important;
    min-height: 108px !important;
    border-radius: 16px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 10px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy h2 {
    font-size: 22px !important;
    line-height: 1.1 !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy p {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy span,
  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy b {
    min-height: 30px !important;
    font-size: 13px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
    min-height: 36px !important;
    height: 36px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .image-secondary-btn,
  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .image-primary-btn {
    height: 36px !important;
    min-height: 36px !important;
  }
}

/* HP first-screen polish 20260623: meter breathing room, compact meta, no home quick chips. */
@media (max-height: 820px) and (max-width: 520px) {
  .phone-screen[data-active-tab="hp"] .hp-v3-meter-card {
    padding-top: 7px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-card::before {
    top: 18px !important;
    right: 6px !important;
    width: 172px !important;
    height: 124px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-card::after {
    background-size: 92px 114px, 23px 23px !important;
    background-position: 40px 28px, calc(100% - 98px) 22px !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
    width: 124px !important;
    height: 124px !important;
    min-width: 124px !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
    inset: 26px !important;
    gap: 4px !important;
    transform: none !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing #hpValue {
    font-size: 34px !important;
    line-height: 34px !important;
    max-width: 86px !important;
    text-align: center !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing:not(.uncalibrated) #hpValue::after {
    font-size: 15px !important;
    margin-left: 3px !important;
  }

  .phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
    font-size: 11px !important;
    line-height: 11px !important;
    white-space: nowrap !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
    width: min(292px, calc(100% - 58px)) !important;
    height: 29px !important;
    min-height: 29px !important;
    bottom: 13px !important;
    gap: 6px !important;
    padding: 0 10px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta span {
    min-height: 24px !important;
    font-size: 11px !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta img {
    width: 18px !important;
    height: 18px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta b {
    font-size: 15px !important;
    line-height: 1 !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card {
    grid-template-rows: 30px 34px 1fr !important;
    align-content: start !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card > .ai-quick-row {
    display: none !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row {
    display: grid !important;
    align-self: end !important;
    margin-top: 6px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions {
    grid-template-columns: 78px minmax(112px, 1fr) 78px !important;
    gap: 8px !important;
  }

  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .secondary-btn {
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: 14px !important;
    letter-spacing: 0 !important;
    padding-inline: 8px !important;
  }
}

/* HP first-screen fixed viewport: the whole home screen now fits, so prevent accidental vertical drift. */
@media (max-width: 520px) {
  .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active {
    overflow: hidden !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    overscroll-behavior: none !important;
    -webkit-overflow-scrolling: auto !important;
    padding-bottom: 0 !important;
    scroll-padding-bottom: 0 !important;
  }
}

/* Chat performance/usability 20260623: faster critical images, no iOS input zoom, centered input controls. */
.phone-screen {
  background:
    url("/web/assets/hp-v4-leaf-frame-fast.webp") center top / 100% 100% no-repeat,
    #fffdf6 !important;
}

.phone-screen[data-active-tab="hp"],
.phone-screen[data-active-tab="task"] {
  background:
    url("/web/assets/hp-v4-leaf-frame-fast.webp") center top / 100% 100% no-repeat,
    #fffdf6 !important;
}

.chat-screen .chat-input-bar {
  grid-template-columns: 48px minmax(0, 1fr) 52px !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 5px 7px !important;
  align-items: center !important;
}

.chat-screen .chat-input-bar input,
.chat-screen #chatInput {
  align-self: center !important;
  height: 38px !important;
  min-height: 38px !important;
  line-height: 38px !important;
  padding: 0 4px !important;
  font-size: 16px !important;
  transform: translateY(0) !important;
}

.chat-screen .chat-input-bar input::placeholder {
  line-height: 38px !important;
}

.chat-screen .chat-voice,
.chat-screen .chat-send {
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 14px !important;
  transform: translateY(0) !important;
}

/* Hotfix 20260623 v7: mobile HP ring breathing room and chat input alignment. */
.phone-screen[data-active-tab="hp"] .hp-v3-meter-card .hp-v3-ring.hp-ring,
.phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 166px !important;
  height: 166px !important;
  min-width: 166px !important;
  transform: none !important;
}

.phone-screen[data-active-tab="hp"] #hpRing .hp-ring-svg {
  inset: -1px !important;
  width: calc(100% + 2px) !important;
  height: calc(100% + 2px) !important;
}

.phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  inset: 39px !important;
  gap: 5px !important;
  align-content: center !important;
  justify-items: center !important;
}

.phone-screen[data-active-tab="hp"] #hpRing #hpValue {
  font-size: 30px !important;
  line-height: 30px !important;
  letter-spacing: 0 !important;
}

.phone-screen[data-active-tab="hp"] #hpRing:not(.uncalibrated) #hpValue::after {
  font-size: 15px !important;
  margin-left: 3px !important;
  vertical-align: baseline !important;
}

.phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
  font-size: 10px !important;
  line-height: 12px !important;
  letter-spacing: 0 !important;
}

.chat-screen .chat-input-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 5px 7px !important;
  box-sizing: border-box !important;
}

.chat-screen #chatInput {
  flex: 1 1 auto !important;
  display: block !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  line-height: 34px !important;
  padding: 0 2px !important;
  margin: 0 !important;
  border: 0 !important;
  font-size: 16px !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.chat-screen #chatInput::placeholder {
  line-height: 34px !important;
}

.chat-screen #chatVoiceBtn,
.chat-screen #chatSendBtn {
  flex: 0 0 auto !important;
  width: 52px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
  transform: translateY(0) !important;
}

/* Hotfix 20260623 v8: shrink HP ring/text so the meta pill never clips it on WeChat mobile. */
.phone-screen[data-active-tab="hp"] .hp-v3-meter-card .hp-v3-ring.hp-ring,
.phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 148px !important;
  height: 148px !important;
  min-width: 148px !important;
  margin-top: 0 !important;
  transform: none !important;
}

.phone-screen[data-active-tab="hp"] #hpRing .hp-ring-svg {
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  inset: 37px !important;
  gap: 4px !important;
  transform: none !important;
}

.phone-screen[data-active-tab="hp"] #hpRing #hpValue {
  font-size: 26px !important;
  line-height: 27px !important;
  max-width: 76px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.phone-screen[data-active-tab="hp"] #hpRing:not(.uncalibrated) #hpValue::after {
  font-size: 13px !important;
  line-height: 1 !important;
  margin-left: 3px !important;
}

.phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
  font-size: 9px !important;
  line-height: 11px !important;
  transform: none !important;
  white-space: nowrap !important;
}

/* Hotfix 20260623 v9: nudge HP ring upward and keep clear of the meta pill on real WeChat viewport. */
.phone-screen[data-active-tab="hp"] .hp-v3-meter-card .hp-v3-ring.hp-ring,
.phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 136px !important;
  height: 136px !important;
  min-width: 136px !important;
  transform: translateY(-8px) !important;
}

.phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  inset: 35px !important;
  gap: 3px !important;
}

.phone-screen[data-active-tab="hp"] #hpRing #hpValue {
  font-size: 24px !important;
  line-height: 25px !important;
  max-width: 70px !important;
}

.phone-screen[data-active-tab="hp"] #hpRing:not(.uncalibrated) #hpValue::after {
  font-size: 12px !important;
  margin-left: 2px !important;
}

.phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
  font-size: 10.5px !important;
  line-height: 12px !important;
}

/* Hotfix 20260623 report performance: one fast background, no layered poster loading. */
.phone-screen[data-active-tab="report"] {
  padding: 0 !important;
  background: url("/web/assets/report-v4-user-bg-fast.webp") center top / cover no-repeat !important;
}

.phone-screen[data-active-tab="report"] .topbar {
  display: none !important;
}

.phone-screen[data-active-tab="report"] .report-v4-page.tab-page.active {
  height: 100dvh !important;
  padding: 0 !important;
  background: transparent !important;
}

.phone-screen[data-active-tab="report"] .report-v4-title,
.phone-screen[data-active-tab="report"] .report-v4-poster,
.phone-screen[data-active-tab="report"] .report-v4-button,
.phone-screen[data-active-tab="report"] .report-result {
  display: none !important;
}

/* Responsive HP viewport fit 20260623: real WeChat height, tiered compression, no overlap. */
:root {
  --app-height: 100dvh;
  --home-fit-scale: 1;
}

html,
body,
.app-shell,
.phone-screen {
  height: var(--app-height) !important;
  min-height: var(--app-height) !important;
  max-height: var(--app-height) !important;
}

.phone-screen[data-active-tab="hp"] {
  overflow: hidden !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active,
.phone-screen[data-active-tab="task"] .task-v4-page.tab-page.active {
  height: calc(var(--app-height) - var(--hp-nav-reserve, 96px)) !important;
  max-height: calc(var(--app-height) - var(--hp-nav-reserve, 96px)) !important;
  min-height: 0 !important;
  padding-top: var(--hp-page-top, 6px) !important;
  padding-bottom: 0 !important;
  gap: var(--hp-page-gap, 7px) !important;
  overflow: hidden !important;
  overflow-y: hidden !important;
  overscroll-behavior: none !important;
}

.phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active {
  transform: scale(var(--home-fit-scale, 1));
  transform-origin: top center;
}

body[data-fit="compact"] {
  --hp-nav-reserve: 94px;
  --hp-page-top: 4px;
  --hp-page-gap: 6px;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-brand,
body[data-fit="compact"] .phone-screen[data-active-tab="task"] .task-v4-brand {
  height: 92px !important;
  min-height: 92px !important;
  flex-basis: 92px !important;
  padding-bottom: 8px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-brand img,
body[data-fit="compact"] .phone-screen[data-active-tab="task"] .task-v4-brand img {
  width: 70px !important;
  height: 88px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-brand h1,
body[data-fit="compact"] .phone-screen[data-active-tab="task"] .task-v4-brand h1 {
  font-size: 27px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-brand p,
body[data-fit="compact"] .phone-screen[data-active-tab="task"] .task-v4-brand p {
  font-size: 14px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-card {
  height: 168px !important;
  min-height: 168px !important;
  max-height: 168px !important;
  padding-top: 6px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  bottom: 11px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card {
  height: 132px !important;
  min-height: 132px !important;
  max-height: 132px !important;
  padding: 8px 14px 9px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
  height: 242px !important;
  min-height: 242px !important;
  max-height: 242px !important;
  flex-basis: 242px !important;
  grid-template-rows: 122px 50px 36px !important;
  gap: 6px !important;
  padding: 9px 12px 10px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
  height: 122px !important;
  min-height: 122px !important;
}

body[data-fit="tight"] {
  --hp-nav-reserve: 88px;
  --hp-page-top: 3px;
  --hp-page-gap: 5px;
}

body[data-fit="tight"] .bottom-tabs {
  height: 68px !important;
  min-height: 68px !important;
  padding-block: 6px !important;
}

body[data-fit="tight"] .bottom-tabs button,
body[data-fit="tight"] .bottom-tabs button.active {
  height: 52px !important;
  max-height: 52px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-brand,
body[data-fit="tight"] .phone-screen[data-active-tab="task"] .task-v4-brand {
  height: 82px !important;
  min-height: 82px !important;
  flex-basis: 82px !important;
  gap: 16px !important;
  padding-bottom: 7px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-brand img,
body[data-fit="tight"] .phone-screen[data-active-tab="task"] .task-v4-brand img {
  width: 62px !important;
  height: 78px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-brand h1,
body[data-fit="tight"] .phone-screen[data-active-tab="task"] .task-v4-brand h1 {
  font-size: 25px !important;
  margin-bottom: 5px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-brand p,
body[data-fit="tight"] .phone-screen[data-active-tab="task"] .task-v4-brand p {
  font-size: 13px !important;
  line-height: 1.12 !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-card {
  height: 154px !important;
  min-height: 154px !important;
  max-height: 154px !important;
  padding-top: 5px !important;
  border-radius: 23px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-card::before {
  top: 16px !important;
  width: 150px !important;
  height: 108px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-card::after {
  background-size: 78px 98px, 20px 20px !important;
  background-position: 34px 24px, calc(100% - 82px) 18px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 118px !important;
  height: 118px !important;
  min-width: 118px !important;
  transform: translateY(-8px) !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  inset: 32px !important;
  gap: 2px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] #hpRing #hpValue {
  font-size: 22px !important;
  line-height: 23px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] #hpRing:not(.uncalibrated) #hpValue::after {
  font-size: 11px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
  font-size: 9.5px !important;
  line-height: 10.5px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  width: min(274px, calc(100% - 56px)) !important;
  height: 27px !important;
  min-height: 27px !important;
  bottom: 9px !important;
  padding-inline: 8px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta span {
  min-height: 22px !important;
  font-size: 10px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta img {
  width: 16px !important;
  height: 16px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta b {
  font-size: 14px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card {
  height: 118px !important;
  min-height: 118px !important;
  max-height: 118px !important;
  grid-template-rows: 28px 30px 1fr !important;
  padding: 7px 12px 8px !important;
  gap: 4px !important;
  border-radius: 22px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-avatar,
body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-avatar-spacer {
  width: 30px !important;
  height: 30px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-bubble-art {
  min-height: 27px !important;
  padding: 4px 11px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row {
  min-height: 32px !important;
  margin-top: 3px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row input {
  height: 32px !important;
  min-height: 32px !important;
  font-size: 12px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row button {
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
  height: 216px !important;
  min-height: 216px !important;
  max-height: 216px !important;
  flex-basis: 216px !important;
  grid-template-rows: 104px 45px 34px !important;
  gap: 6px !important;
  padding: 8px 10px 9px !important;
  border-radius: 22px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
  height: 104px !important;
  min-height: 104px !important;
  border-radius: 16px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
  height: 45px !important;
  min-height: 45px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy h2 {
  font-size: 20px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy p {
  font-size: 10px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  height: 34px !important;
  min-height: 34px !important;
  grid-template-columns: 70px minmax(118px, 1fr) 72px !important;
}

body[data-fit="ultra"] {
  --hp-nav-reserve: 84px;
  --hp-page-top: 2px;
  --hp-page-gap: 4px;
}

body[data-fit="ultra"] .bottom-tabs {
  height: 64px !important;
  min-height: 64px !important;
  padding-block: 5px !important;
}

body[data-fit="ultra"] .bottom-tabs button,
body[data-fit="ultra"] .bottom-tabs button.active {
  height: 50px !important;
  max-height: 50px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-brand,
body[data-fit="ultra"] .phone-screen[data-active-tab="task"] .task-v4-brand {
  height: 72px !important;
  min-height: 72px !important;
  flex-basis: 72px !important;
  gap: 13px !important;
  padding-bottom: 6px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-brand img,
body[data-fit="ultra"] .phone-screen[data-active-tab="task"] .task-v4-brand img {
  width: 56px !important;
  height: 70px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-brand h1,
body[data-fit="ultra"] .phone-screen[data-active-tab="task"] .task-v4-brand h1 {
  font-size: 22px !important;
  margin-bottom: 4px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-brand p,
body[data-fit="ultra"] .phone-screen[data-active-tab="task"] .task-v4-brand p {
  font-size: 12px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-card {
  height: 144px !important;
  min-height: 144px !important;
  max-height: 144px !important;
  border-radius: 21px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 108px !important;
  height: 108px !important;
  min-width: 108px !important;
  transform: translateY(-8px) !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  inset: 30px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] #hpRing #hpValue {
  font-size: 20px !important;
  line-height: 21px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  bottom: 8px !important;
  width: min(260px, calc(100% - 52px)) !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card {
  height: 122px !important;
  min-height: 122px !important;
  max-height: 122px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
  height: 202px !important;
  min-height: 202px !important;
  max-height: 202px !important;
  flex-basis: 202px !important;
  grid-template-rows: 94px 42px 32px !important;
  gap: 5px !important;
  padding: 7px 10px 8px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
  height: 94px !important;
  min-height: 94px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
  height: 42px !important;
  min-height: 42px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy h2 {
  font-size: 18px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  height: 32px !important;
  min-height: 32px !important;
  grid-template-columns: 74px minmax(104px, 1fr) 74px !important;
  gap: 6px !important;
}

/* Responsive HP viewport fit v2: comfortable tier baseline; smaller tiers keep their own compact rules. */
body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active,
body[data-fit="comfortable"] .phone-screen[data-active-tab="task"] .task-v4-page.tab-page.active {
  height: calc(var(--app-height) - var(--hp-nav-reserve, 96px)) !important;
  max-height: calc(var(--app-height) - var(--hp-nav-reserve, 96px)) !important;
  padding-top: var(--hp-page-top, 6px) !important;
  gap: var(--hp-page-gap, 7px) !important;
  overflow: hidden !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-brand,
body[data-fit="comfortable"] .phone-screen[data-active-tab="task"] .task-v4-brand {
  height: 104px !important;
  min-height: 104px !important;
  flex-basis: 104px !important;
  padding-bottom: 9px !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-card {
  height: 180px !important;
  min-height: 180px !important;
  max-height: 180px !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card {
  height: 132px !important;
  min-height: 132px !important;
  max-height: 132px !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card {
  grid-template-rows: 30px 36px 36px !important;
  align-content: start !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-card > .ai-quick-row {
  display: none !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row {
  display: grid !important;
  align-self: end !important;
  margin-top: 4px !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-card {
  height: 348px !important;
  min-height: 348px !important;
  max-height: 348px !important;
  flex-basis: 348px !important;
  grid-template-rows: 216px 54px 42px !important;
  gap: 7px !important;
  padding: 10px 12px 12px !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-image {
  height: 216px !important;
  min-height: 216px !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-task-copy {
  height: 54px !important;
  min-height: 54px !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  height: 42px !important;
  min-height: 42px !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 120px !important;
  height: 120px !important;
  min-width: 120px !important;
  transform: translateY(4px) !important;
}

body[data-fit="comfortable"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  bottom: 3px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 112px !important;
  height: 112px !important;
  min-width: 112px !important;
  transform: translateY(3px) !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  inset: 30px !important;
  gap: 2px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] #hpRing #hpValue {
  font-size: 22px !important;
  line-height: 23px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] #hpRing:not(.uncalibrated) #hpValue::after {
  font-size: 11px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
  font-size: 9.5px !important;
  line-height: 10.5px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  width: min(282px, calc(100% - 56px)) !important;
  height: 27px !important;
  min-height: 27px !important;
  bottom: 5px !important;
  padding-inline: 8px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta span {
  min-height: 22px !important;
  font-size: 10px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta img {
  width: 16px !important;
  height: 16px !important;
}

body[data-fit="compact"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta b {
  font-size: 14px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  bottom: 7px !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 108px !important;
  height: 108px !important;
  min-width: 108px !important;
  transform: translateY(2px) !important;
}

body[data-fit="tight"] .phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  inset: 29px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] .hp-v3-meter-meta {
  bottom: 1px !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] #hpRing.hp-v3-ring.hp-ring {
  width: 100px !important;
  height: 100px !important;
  min-width: 100px !important;
  transform: translateY(1px) !important;
}

body[data-fit="ultra"] .phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  inset: 28px !important;
}

/* HP home chat input containment: keep send button fully inside the second card. */
body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row {
  grid-template-columns: minmax(0, 1fr) 40px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 2px !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row input {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  line-height: 36px !important;
  padding-block: 0 !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row button {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-ai-input-row button img {
  width: 38px !important;
  height: 38px !important;
}

/* HP responsive stability lock: keep recovery action labels single-line across WeChat viewports. */
body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions,
body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions.compact-panel {
  grid-template-columns: clamp(78px, 22vw, 92px) minmax(112px, 1fr) clamp(78px, 22vw, 92px) !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .secondary-btn {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-wrap: nowrap !important;
  line-height: 1 !important;
  padding-inline: 6px !important;
  font-size: clamp(13px, 3.55vw, 16px) !important;
  letter-spacing: 0 !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] .hp-v3-page.tab-page.active .hp-v3-actions .primary-btn.image-primary-btn {
  min-width: 112px !important;
}

/* HP ring inner layout lock: calibrated and uncalibrated text must stay centered together. */
body[data-fit] .phone-screen[data-active-tab="hp"] #hpRing .hp-ring-label {
  position: absolute !important;
  inset: 28% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  transform: none !important;
  text-align: center !important;
  z-index: 3 !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] #hpRing #hpValue {
  position: static !important;
  display: inline-flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  color: #123543 !important;
  font-size: clamp(24px, 7.1vw, 32px) !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] #hpRing:not(.uncalibrated) #hpValue::after {
  content: "/100" !important;
  display: inline !important;
  position: static !important;
  color: #6f7c83 !important;
  font-size: .46em !important;
  line-height: 1 !important;
  margin-left: 3px !important;
  vertical-align: baseline !important;
  transform: none !important;
}

body[data-fit] .phone-screen[data-active-tab="hp"] #hpRing #hpStatus {
  position: static !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #4f765d !important;
  font-size: clamp(10px, 2.75vw, 13px) !important;
  line-height: 1.05 !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}


