/*
 * V7.1 home action architecture
 * Four regions only: user state, AI advice, recent task, quick access.
 */

html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 22px clamp(18px, 2.4vw, 34px) 40px !important;
}

html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > * {
  display: none !important;
}

html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > :is(
  .landing-welcome-panel,
  .landing-v5-command-center,
  .landing-weekly-growth,
  .landing-home-shortcuts
) {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-engineering-status {
  display: none !important;
}

/* Region 1: user state */
html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-welcome-panel {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  order: 1 !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 138px !important;
  padding: 20px 24px !important;
  overflow: hidden !important;
  color: var(--v51-text, #0f172a) !important;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--hw-primary, #1677ff) 7%, var(--v51-card, #fff)), var(--v51-card, #fff) 42%) !important;
  border: 1px solid var(--v51-border, #dbe4f0) !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

html body[data-active-panel="landing"] .landing-welcome-panel .landing-profile-avatar {
  width: 62px !important;
  min-width: 62px !important;
  height: 62px !important;
  margin: 0 !important;
  border-radius: 18px !important;
}

html body[data-active-panel="landing"] .landing-welcome-panel .landing-welcome-copy {
  display: grid !important;
  grid-template-columns: minmax(190px, 0.62fr) minmax(0, 1.38fr) !important;
  align-items: center !important;
  gap: 24px !important;
  width: 100% !important;
  min-width: 0 !important;
}

html body[data-active-panel="landing"] .landing-welcome-panel .landing-greeting-line {
  margin: 0 !important;
  color: var(--v51-text, #0f172a) !important;
  font-size: clamp(23px, 2.2vw, 30px) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
}

html body[data-active-panel="landing"] .landing-user-status-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

html body[data-active-panel="landing"] .landing-user-status-grid > div {
  display: grid !important;
  align-content: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  min-height: 72px !important;
  padding: 12px 14px !important;
  background: color-mix(in srgb, var(--v51-card-soft, #f8fafc) 84%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--v51-border, #dbe4f0) 82%, transparent) !important;
  border-radius: 13px !important;
}

html body[data-active-panel="landing"] .landing-user-status-grid span {
  color: var(--v51-muted, #64748b) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

html body[data-active-panel="landing"] .landing-user-status-grid strong {
  overflow: hidden !important;
  color: var(--v51-text, #0f172a) !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body[data-active-panel="landing"] .landing-user-status-grid > div:last-child strong {
  color: var(--hw-primary, #1677ff) !important;
}

/* Region 2: AI recommendation */
html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-v5-command-center {
  display: grid !important;
  order: 2 !important;
  align-content: start !important;
  gap: 20px !important;
  min-height: 0 !important;
  padding: 28px clamp(150px, 14vw, 188px) 28px 30px !important;
  overflow: hidden !important;
  color: var(--v51-text, #0f172a) !important;
  background:
    radial-gradient(circle at 92% 12%, rgba(124, 58, 237, 0.16), transparent 31%),
    linear-gradient(135deg, color-mix(in srgb, var(--hw-primary, #1677ff) 9%, var(--v51-card, #fff)), var(--v51-card, #fff) 58%) !important;
  border: 1px solid color-mix(in srgb, var(--hw-ai, #7c3aed) 28%, var(--v51-border, #dbe4f0)) !important;
  border-radius: 20px !important;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.09) !important;
}

html body[data-active-panel="landing"] .landing-v5-command-center > .landing-task-header,
html body[data-active-panel="landing"] .landing-v5-command-center :is(
  .landing-target-gap,
  .landing-task-score,
  .landing-task-rationale,
  .landing-task-metrics
) {
  display: none !important;
}

html body[data-active-panel="landing"] .landing-v5-command-center > .landing-ai-advice-header {
  display: block !important;
  margin: 0 !important;
}

html body[data-active-panel="landing"] .landing-ai-advice-header .eyebrow {
  margin: 0 0 5px !important;
  color: var(--hw-ai, #7c3aed) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.14em !important;
}

html body[data-active-panel="landing"] .landing-ai-advice-header h2 {
  margin: 0 !important;
  color: var(--v51-text, #0f172a) !important;
  font-size: clamp(25px, 2.6vw, 34px) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.025em !important;
}

html body[data-active-panel="landing"] .landing-v5-command-center .landing-task-body,
html body[data-active-panel="landing"] .landing-v5-command-center .landing-today-advice {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-panel {
  display: grid !important;
  gap: 10px !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-panel > span {
  color: var(--v51-muted, #64748b) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-list article {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 86px !important;
  padding: 15px 16px !important;
  color: var(--v51-text, #0f172a) !important;
  background: color-mix(in srgb, var(--v51-card, #fff) 82%, transparent) !important;
  border: 1px solid var(--v51-border, #dbe4f0) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-list article > i {
  display: grid !important;
  width: 34px !important;
  height: 34px !important;
  place-items: center !important;
  color: var(--hw-ai, #7c3aed) !important;
  background: color-mix(in srgb, var(--hw-ai, #7c3aed) 12%, transparent) !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-style: normal !important;
  font-weight: 900 !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-list article > div {
  display: grid !important;
  gap: 5px !important;
  min-width: 0 !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-list strong {
  overflow: hidden !important;
  color: var(--v51-text, #0f172a) !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-list p {
  margin: 0 !important;
  color: var(--v51-muted, #64748b) !important;
  font-size: 12px !important;
}

html body[data-active-panel="landing"] .landing-ai-weakness-list p b {
  color: var(--hw-ai, #7c3aed) !important;
  font-size: 14px !important;
}

html body[data-active-panel="landing"] .landing-v5-command-center .landing-task-action-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  min-height: 72px !important;
  margin-top: 18px !important;
  padding: 15px 16px !important;
  background: color-mix(in srgb, var(--hw-primary, #1677ff) 6%, var(--v51-card, #fff)) !important;
  border: 1px solid color-mix(in srgb, var(--hw-primary, #1677ff) 18%, var(--v51-border, #dbe4f0)) !important;
  border-radius: 14px !important;
}

html body[data-active-panel="landing"] .landing-ai-training-suggestion {
  display: grid !important;
  gap: 4px !important;
}

html body[data-active-panel="landing"] .landing-ai-training-suggestion span {
  color: var(--v51-muted, #64748b) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

html body[data-active-panel="landing"] .landing-ai-training-suggestion strong {
  color: var(--v51-text, #0f172a) !important;
  font-size: 18px !important;
}

html body[data-active-panel="landing"] #landingStartInterviewBtn.landing-primary-action {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  min-width: 128px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 22px !important;
  transform: none !important;
}

/* Region 3: recent task list */
html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-weekly-growth {
  display: grid !important;
  order: 3 !important;
  gap: 14px !important;
  min-height: 0 !important;
  padding: 20px 22px !important;
  color: var(--v51-text, #0f172a) !important;
  background: var(--v51-card, #fff) !important;
  border: 1px solid var(--v51-border, #dbe4f0) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}

html body[data-active-panel="landing"] .landing-weekly-growth-head {
  display: flex !important;
  align-items: end !important;
  justify-content: space-between !important;
  gap: 16px !important;
}

html body[data-active-panel="landing"] .landing-weekly-growth-head :is(.eyebrow, h2) {
  margin: 0 !important;
}

html body[data-active-panel="landing"] .landing-weekly-growth-head h2 {
  margin-top: 4px !important;
  color: var(--v51-text, #0f172a) !important;
  font-size: 21px !important;
}

html body[data-active-panel="landing"] .landing-weekly-growth-head > span {
  color: var(--v51-muted, #64748b) !important;
  font-size: 11px !important;
}

html body[data-active-panel="landing"] .landing-weekly-growth-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

html body[data-active-panel="landing"] .landing-recent-task-card {
  display: grid !important;
  grid-template-columns: minmax(220px, 0.72fr) minmax(320px, 1.28fr) !important;
  align-items: center !important;
  gap: 24px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 92px !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  color: var(--v51-text, #0f172a) !important;
  background: var(--v51-card-soft, #f8fafc) !important;
  border: 1px solid var(--v51-border, #dbe4f0) !important;
  border-radius: 13px !important;
}

html body[data-active-panel="landing"] .landing-recent-task-copy {
  display: grid !important;
  gap: 5px !important;
  min-width: 0 !important;
}

html body[data-active-panel="landing"] .landing-recent-task-copy > span {
  color: var(--hw-primary, #1677ff) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

html body[data-active-panel="landing"] .landing-recent-task-copy > h3 {
  margin: 0 !important;
  color: var(--v51-text, #0f172a) !important;
  font-size: 18px !important;
  line-height: 1.35 !important;
}

html body[data-active-panel="landing"] .landing-recent-task-copy > p {
  display: none !important;
}

html body[data-active-panel="landing"] .landing-recent-task-progress {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

html body[data-active-panel="landing"] .landing-recent-task-progress > span {
  color: var(--v51-muted, #64748b) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

html body[data-active-panel="landing"] .landing-recent-task-progress > div {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

html body[data-active-panel="landing"] .landing-recent-task-progress i {
  display: block !important;
  flex: 1 1 auto !important;
  height: 7px !important;
  overflow: hidden !important;
  background: color-mix(in srgb, var(--v51-text, #0f172a) 9%, transparent) !important;
  border-radius: 999px !important;
}

html body[data-active-panel="landing"] .landing-recent-task-progress i > b {
  display: block !important;
  height: 100% !important;
  background: linear-gradient(90deg, var(--hw-primary, #1677ff), var(--hw-ai, #7c3aed)) !important;
  border-radius: inherit !important;
}

html body[data-active-panel="landing"] .landing-recent-task-progress > div > strong {
  min-width: 38px !important;
  color: var(--v51-text, #0f172a) !important;
  font-size: 12px !important;
  text-align: right !important;
}

html body[data-active-panel="landing"] .landing-recent-task-progress > button {
  min-width: 78px !important;
  min-height: 38px !important;
  padding-inline: 16px !important;
}

/* Region 4: compact quick access */
html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-home-shortcuts {
  display: grid !important;
  order: 4 !important;
  gap: 14px !important;
  min-height: 0 !important;
  padding: 20px 22px !important;
  color: var(--v51-text, #0f172a) !important;
  background: var(--v51-card, #fff) !important;
  border: 1px solid var(--v51-border, #dbe4f0) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}

html body[data-active-panel="landing"] .landing-home-shortcuts-head {
  display: block !important;
}

html body[data-active-panel="landing"] .landing-home-shortcuts-head :is(.eyebrow, h2) {
  margin: 0 !important;
}

html body[data-active-panel="landing"] .landing-home-shortcuts-head h2 {
  margin-top: 4px !important;
  color: var(--v51-text, #0f172a) !important;
  font-size: 21px !important;
}

html body[data-active-panel="landing"] .landing-home-shortcut-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

html body[data-active-panel="landing"] .landing-home-shortcut-grid > button {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 11px !important;
  min-width: 0 !important;
  min-height: 66px !important;
  padding: 12px 14px !important;
  color: var(--v51-text, #0f172a) !important;
  background: var(--v51-card-soft, #f8fafc) !important;
  border: 1px solid var(--v51-border, #dbe4f0) !important;
  border-radius: 13px !important;
  box-shadow: none !important;
  text-align: left !important;
}

html body[data-active-panel="landing"] .landing-home-shortcut-grid > button:hover {
  color: var(--hw-primary, #1677ff) !important;
  background: color-mix(in srgb, var(--hw-primary, #1677ff) 7%, var(--v51-card, #fff)) !important;
  border-color: color-mix(in srgb, var(--hw-primary, #1677ff) 38%, var(--v51-border, #dbe4f0)) !important;
  transform: translateY(-1px) !important;
}

html body[data-active-panel="landing"] .landing-home-shortcut-grid > button > span {
  display: grid !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  place-items: center !important;
  color: var(--hw-primary, #1677ff) !important;
  background: color-mix(in srgb, var(--hw-primary, #1677ff) 9%, transparent) !important;
  border-radius: 10px !important;
  font-size: 17px !important;
}

html body[data-active-panel="landing"] .landing-home-shortcut-grid > button > strong {
  overflow: hidden !important;
  color: inherit !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body[data-active-panel="landing"] .landing-home-shortcut-grid > button > em {
  display: none !important;
}

html[data-theme="dark"] body[data-active-panel="landing"] :is(
  .landing-user-status-grid > div,
  .landing-ai-weakness-list article,
  .landing-recent-task-card,
  .landing-home-shortcut-grid > button
) {
  background: #0f1b2d !important;
  border-color: #26364c !important;
}

@media (max-width: 980px) {
  html body[data-active-panel="landing"] .landing-welcome-panel .landing-welcome-copy {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  html body[data-active-panel="landing"] .landing-ai-weakness-list,
  html body[data-active-panel="landing"] .landing-recent-task-card {
    grid-template-columns: 1fr !important;
  }

  html body[data-active-panel="landing"] .landing-home-shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid {
    padding-inline: 14px !important;
  }

  html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-welcome-panel {
    grid-template-columns: 1fr !important;
    padding: 18px !important;
  }

  html body[data-active-panel="landing"] .landing-welcome-panel .landing-profile-avatar {
    display: none !important;
  }

  html body[data-active-panel="landing"] .landing-user-status-grid,
  html body[data-active-panel="landing"] .landing-ai-weakness-list {
    grid-template-columns: 1fr !important;
  }

  html body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-v5-command-center {
    padding: 22px !important;
  }

  html body[data-active-panel="landing"] .landing-v5-command-center .landing-task-action-row {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  html body[data-active-panel="landing"] #landingStartInterviewBtn.landing-primary-action {
    width: 100% !important;
  }

  html body[data-active-panel="landing"] .landing-recent-task-progress {
    grid-template-columns: 1fr !important;
  }

  html body[data-active-panel="landing"] .landing-home-shortcut-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Terminal four-region lock: outrank the legacy :is(#hw-v6-home, html) rules. */
:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > * {
  display: none !important;
}

:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-welcome-panel {
  display: grid !important;
}

:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > :is(
  .landing-v5-command-center,
  .landing-weekly-growth,
  .landing-home-shortcuts
) {
  display: grid !important;
}

:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > .landing-home-grid > .landing-engineering-status {
  display: none !important;
}

/* Exact DOM terminal lock for the legacy card selectors. */
:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > div.landing-home-grid > article.section-card.landing-welcome-panel[data-home-module-key="welcome"] {
  display: grid !important;
}

:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > div.landing-home-grid > article.section-card.landing-v5-command-center[data-home-module-key="v5-command-center"],
:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > div.landing-home-grid > article.section-card.landing-weekly-growth[data-home-module-key="recent-task"],
:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > div.landing-home-grid > article.section-card.landing-home-shortcuts[data-home-module-key="shortcuts"] {
  display: grid !important;
}

:is(#hw-v72-home, html) body[data-active-panel="landing"] .shell .main.main > section.panel.active.landing-workspace > div.landing-home-grid > article.section-card.landing-engineering-status[data-home-module-key="engineering-status"] {
  display: none !important;
}

